coreruleset: Rule 920100 Fails Due to PCRE Limits Error
Description
Rule 920100 fails for long URLs due to MSC_PCRE_LIMITS_EXCEEDED. The URL is long, but not unreasonable.
How to reproduce the misbehavior (-> curl call)
curl -H "x-format-output: txt-matched-rules" https://sandbox.coreruleset.org/robots.txt?q=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
920100 PL1 Invalid HTTP Request Line
200005 PL1 ModSecurity internal error flagged: TX:MSC_PCRE_LIMITS_EXCEEDED
980170 PL1 Anomaly Scores: (Inbound Scores: blocking=3, detection=3, per_pl=3-0-0-0, threshold=5) - (Outbound Scores: blocking=0, detection=0, per_pl=0-0-0-0, threshold=4) - (SQLI=0, XSS=0, RFI=0, LFI=0, RCE=0, PHPI=0, HTTP=0, SESS=0, COMBINED_SCORE=3)
Confirmation
- I have removed any personal data (email addresses, IP addresses, passwords, domain names) from any logs posted.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 25 (24 by maintainers)
I did some experimenting with this.
MSC_PCRE_LIMITS_EXCEEDED) and is blocked.!@rxto@rx, it does not log rule 920100, but does log rule 200005 (MSC_PCRE_LIMITS_EXCEEDED). The request is NOT blocked.My theory is that rule 920100 is triggering
MSC_PCRE_LIMITS_EXCEEDED(otherwise experiment 1 would log rule 200005 too) and it’s probably the ModSecurity library’s handling of failed regular expressions that is buggy. I think that the rule is triggeringMSC_PCRE_LIMITS_EXCEEDED, but the library is saying that because it’s checking if the regular expression did NOT match, it says that it didn’t match due to the internal error and hence saying the URL doesn’t match the regular expression when in reality, it is unknown whether it matches or not.So I think there are 2 bugs:
!@rxdifferently when the regex failed. I feel like it should not trigger the rule.