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

Failed when checking null value #1785

Closed
XuanHuyDuong opened this issue May 25, 2018 · 2 comments
Closed

Failed when checking null value #1785

XuanHuyDuong opened this issue May 25, 2018 · 2 comments
Assignees
Labels
3.x Related to ModSecurity version 3.x bug It is a confirmed bug pending feedback RIP - libmodsecurity
Milestone

Comments

@XuanHuyDuong
Copy link

Hello dev team,

I'm using Nginx + Modsecurity v3/master. I found an error when checking null value. I checked User-Agent value with operator "^$". Here is result:
image

As you see, User-Agent value is null but result of this rule is false. I checked it using CRS regression. Here are rule and testcase:
image
image

I hope you will reply soon. Thank you!

@victorhora victorhora added RIP - libmodsecurity 3.x Related to ModSecurity version 3.x bug It is a confirmed bug labels May 28, 2018
@victorhora victorhora added this to the v3.0.3 milestone May 28, 2018
@victorhora
Copy link
Contributor

Hi @XuanHuyDuong,

I can confirm this issue.

It seemed like Regex::searchAll which is called by the @rx operator here was not getting added to retList due to the length of the subject string (e.g. User-Agent) being "0" ending up in a condition that returned an empty list leading to a failed match by the @rx operator

I have suggested fix at #1788. So far it's looking good with the tests and buildbots, but it needs further review from @zimmerle in case it breaks some other condition that I'm currently not aware.

@zimmerle
Copy link
Contributor

Fixed at: fd8e72f

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 bug It is a confirmed bug pending feedback RIP - libmodsecurity
Projects
None yet
Development

No branches or pull requests

3 participants