coreruleset: False Positive in 920220

Description

920220 execute validateUrlEncoding over the whole REQUEST_URI. This lead to a false positive when a request comes with an argument value that contains a percentage (example with=100%&heigth=100%). Even if the argument width is correctly encoded (width=100%25&...) the rule triggers maybe because %25&h is not a valid hex sequence.

What about replacing REQUEST_URI with ARGS? Moreover, in the rule logic comment, we mention something about REQUEST_BODY. Is it related to something that has been removed?

Audit Logs / Triggered Rule Numbers

Request: /admin/index.php?width=100%25&height=270

Rule: 920220 URL Encoding Abuse Attack Attempt

https://github.com/coreruleset/coreruleset/blob/de26f0df363733ae3414ef20653ca8d5281188da/rules/REQUEST-920-PROTOCOL-ENFORCEMENT.conf#L347-L379

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 15 (13 by maintainers)

Most upvoted comments

Maybe we should start to put a condition to certain rules or to write a different version of the same rule to keep compatibility with v2 and v3. something like:

Sounds like a topic for tonight’s meeting 😄

IIRC when using REQUEST_URI the query string is not automatically url-decoded, so the rule should be seeing /test.php?w=100%25&h=100. I will confirm tomorrow but this sounds like a non-backward compatible change in modsec 3.