Allow empty strings to be evaluated by regex::searchAll #1788
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 :)