Skip to content

Allow empty strings to be evaluated by regex::searchAll #1788

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

Closed
wants to merge 1 commit into from
Closed

Allow empty strings to be evaluated by regex::searchAll #1788

wants to merge 1 commit into from

Conversation

victorhora
Copy link
Contributor

Proposed fix for issue described at #1785. Confirmed working on my set of tests, and now empty strings seems to be evaluated properly by regex::searchAll when using the caret and dollar operators (^$)

ModSecurity: Warning. Matched "Operator `Rx' with parameter `^$' against variable `REQUEST_HEADERS:User-Agent' (Value: `' ) [file "/usr/local/nginx/conf/modsecur$ty.conf"] [line "287"] [id "123456"] [rev ""] [msg ""] [data "Matched data: "] [severity "0"] [ver ""] [maturity "0"] [accuracy "0"] [hostname "192.168.37.1"] [u$i "/"] [unique_id "152663695450.272548"] [ref "o0,0v56,0"] ModSecurity: Warning. Matched "Operator `Rx' with parameter `^$' against variable `REQUEST_HEADERS:Accept' (Value: `' ) [file "/usr/local/nginx/conf/modsecurity.$onf"] [line "721"] [id "12345"] [rev ""] [msg ""] [data "Matched data: "] [severity "0"] [ver ""] [maturity "0"] [accuracy "0"] [hostname "192.168.37.1"] [uri "/$] [unique_id "152663695450.272548"] [ref "o0,0v81,0"] ModSecurity: Warning. Matched "Operator `Rx' with parameter `^apache$' against variable `ARGS:param1' (Value: `apache' ) [file "/usr/local/nginx/conf/modsecurity$conf"] [line "722"] [id "1234"] [rev ""] [msg ""] [data "Matched data: apache"] [severity "0"] [ver ""] [maturity "0"] [accuracy "0"] [hostname "192.168.37.1"] [$ri "/"] [unique_id "152663695450.272548"] [ref "o0,6v21,6"]

Testsuites seems happy as well :)

image

@victorhora victorhora added bug It is a confirmed bug RIP - libmodsecurity RIP - release-3.0 3.x Related to ModSecurity version 3.x labels May 29, 2018
@victorhora victorhora added this to the v3.0.3 milestone May 29, 2018
@victorhora victorhora requested a review from zimmerle May 29, 2018 06:05
@zimmerle
Copy link
Contributor

Merged! thanks!

@zimmerle zimmerle closed this Jun 19, 2018
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 RIP - libmodsecurity RIP - release-3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants