Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regular Expression Failure Triggers !@rx #3123

Open
ssigwart opened this issue Apr 19, 2024 · 1 comment
Open

Regular Expression Failure Triggers !@rx #3123

ssigwart opened this issue Apr 19, 2024 · 1 comment
Assignees
Labels
3.x Related to ModSecurity version 3.x

Comments

@ssigwart
Copy link

Describe the bug

When there's a regular expression error due to SecPcreMatchLimit or SecPcreMatchLimitRecursion (i.e. MSC_PCRE_LIMITS_EXCEEDED), a rule using !@rx will say that the rule was triggered. However, failures with @rx will say that the rule was not triggered. I think both should assume the rule was not triggered. See coreruleset/coreruleset#3640 (comment) for additional context.

To Reproduce

See coreruleset/coreruleset#3640 (comment).

You can probably reproduce by setting SecPcreMatchLimit and SecPcreMatchLimitRecursion really low (maybe 5) and adding a !@rx rule.

Expected behavior

I would expect !@rx to not trigger a rule if there's a MSC_PCRE_LIMITS_EXCEEDED error.

Server (please complete the following information):

  • ModSecurity version (and connector): ModSecurity v3.0.12 with nginx-connector v1.0.3
  • WebServer: nginx-1.24.0
  • OS (and distro): Amazon Linux 2

Rule Set (please complete the following information):

  • Running any public or commercial rule set? CRS
  • What is the version number? 4.1.0
@ssigwart ssigwart added the 3.x Related to ModSecurity version 3.x label Apr 19, 2024
@airween
Copy link
Member

airween commented Apr 19, 2024

Hi @ssigwart,

thanks for reporting, I will take a look at this issue soon.

@airween airween self-assigned this Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Related to ModSecurity version 3.x
Projects
None yet
Development

No branches or pull requests

2 participants