question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rule 942200 triggers a substantial number of false positives.

See original GitHub issue

Description

Not sure what rule 942200 is supposed to do exactly (as it’s not docummented nor has tests), but it yields a lot false-positives. For example, the simple payload like this gets blocked: ?text=yes, bob's.

For the corpus wikipedia_2016_1M it yields 28342 results.

$ grep -i -E -c -f regexes.txt ./eng_wikipedia_2016_1M/eng_wikipedia_2016_1M-sentences.txt
28342

The the most critical expression from 942200.data is ,.*?[)\da-f\"'`][\"'`][^\"'`]+ which alone yields 27983 results.

TBF, the rule doesn’t seem to be doing anything useful (except \Wselect.+\W*?from which doesn’t fit the rule and should be moved somewhere else) so I’d consider disabling it. One thing for sure it needs a docummentation and tests.

The usage of the word space also seems to be a bug.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
FYN-Michielcommented, Nov 10, 2022

Adding them to RESPONSE-999-EXCLUSION-RULES-AFTER-CRS.conf works, learning every day 😃

For people finding this ticket:

SecRuleUpdateTargetById 942260 !REQUEST_COOKIES
SecRuleUpdateTargetById 942340 !REQUEST_COOKIES
SecRuleUpdateTargetById 942200 !REQUEST_COOKIES
SecRuleUpdateTargetById 942370 !REQUEST_COOKIES

SecRuleUpdateTargetById 920300 !REQUEST_HEADERS
1reaction
theseioncommented, May 29, 2022

msg:'Detects MySQL comment-/space-obfuscated injections and backtick termination' space is a function in MysQL, apparently.

The SLQi rules are a mess and we’re in the process of cleaning them up. It will probably be a while before we can address this particular issue, so I’ve added a new sqli label.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handling False Positives with the OWASP ... - netnea
We will take a vanilla installation of the OWASP ModSecurity Core Rule Set (CRS) troubled by a large number of false positives and...
Read more >
How to tune your WAF installation to reduce false positives
The first number given is the number of false positives. The second number is the ID of the rule that was triggered. The...
Read more >
Troubleshoot - Azure Web Application Firewall - Microsoft Learn
Fixing false positives. With this information, and the knowledge that rule 942130 is the one that matched the 1=1 string, you can do...
Read more >
[Owasp-modsecurity-core-rule-set] RegEx in CRS 3.0.2 ...
I've been looking at some false positives related to rule 942200. Side note, I'm running CRS 3.0.2 but the rules still have a...
Read more >
Very large amount of false positives with rule 932200 #1818
no rule triggered at PL1 (is this sent on request body with content-type application/json?)
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found