Skip to content

Conversation

EsadCetiner
Copy link
Member

I excluded matching on colons for the bash brace rules to avoid matching json payloads with no spaces. I know that PL-2 rules generally struggle with JSON payloads when they're sent within a urlencoded payload and similar, but this PR shouldn't cause any false negatives as colons aren't treated as anything special. It will also avoid existing users needing to deal with the new false positives.

@EsadCetiner EsadCetiner requested a review from Xhoenix July 8, 2025 14:45
Copy link
Contributor

github-actions bot commented Jul 8, 2025

📊 Quantitative test results for language: eng, year: 2023, size: 10K, paranoia level: 1:
🚀 Quantitative testing did not detect new false positives

@fzipi fzipi changed the title fix(932281): Avoid matching on json payloads fix(932281): avoid matching on json payloads Jul 9, 2025
Copy link
Member

@fzipi fzipi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@watford-ep
Copy link

I wonder if this is what is plaguing us with Cloudflare's WAF and the OWASP Core Ruleset: https://community.cloudflare.com/t/owasp-ruleset-unexpectedly-has-a-high-false-positive-rate/814544

@EsadCetiner
Copy link
Member Author

@watford-ep This PR only touches rule 932281 which I don't see in any of your screenshots, so this isn't the cause of your issues.

I suggest using a lower paranoia level as PL-2 and above are known to have false positives due since the rules are more aggressive. If your still having problems with false positives at PL-1 (Default paranoia level) then you'll need to create a rule exclusion. I'm not very familiar with Cloudflare's WAF so I won't be able to help you there.

@EsadCetiner EsadCetiner added this pull request to the merge queue Jul 9, 2025
Merged via the queue into coreruleset:main with commit 8d693ef Jul 9, 2025
7 checks passed
@EsadCetiner EsadCetiner deleted the fix-fp-jsondata branch July 9, 2025 21:25
@fzipi
Copy link
Member

fzipi commented Jul 9, 2025

No, I definitely can confirm that this is not the case. I don't think cloudflare is using v4 at all. But let me take a look.

@sixlettervariables
Copy link

@fzipi thanks, it popped up out of nowhere on a holiday weekend which was a surprise!

@fzipi
Copy link
Member

fzipi commented Jul 9, 2025

@sixlettervariables No worries. I had problems with axios also in the past, but IMHO it was/is because it is not sending proper headers. Therefore it is not matching as application/json and ultimately not being sent to the proper parser. Naturally you will be matching a bunch of unrelated rules.

Maybe you can try this using our sandbox and see if you can reproduce.

The worst part is that when logging, you only have the payload (body). There is no header logging available. The answer I got from support was to "just use your own web server or load balancer to get all the headers". Which is ........... (fill in the blanks).

@fzipi
Copy link
Member

fzipi commented Jul 9, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants