Closed Napsty closed 2 years ago
i belive this is an issue with the $URL:
filter and URL
matchzone. you can't have both.
Do you have an example how to get to use the ANY match zone?
Can you test the open PR and check if it fixes the issue?
Sorry, did not find time to do this yet.
it's ok, i have added a test for this.
Re-compiled the module with the current version of the main branch. Yes, it's working now!
WL Rule:
BasicRule wl:1000,1011,1013 "mz:$URL:/|ANY";
Request:
$ curl "http://192.168.15.187/?id=)union%27select" -I
HTTP/1.1 200 OK
Server: nginx/1.18.0
Date: Mon, 21 Nov 2022 12:53:23 GMT
Content-Type: text/html
Content-Length: 612
Last-Modified: Wed, 21 Sep 2022 13:21:27 GMT
Connection: keep-alive
ETag: "632b0fd7-264"
Accept-Ranges: bytes
Thanks!
Thanks for having added the
ANY
match zone, which can be combined with eithermz:$URL:
ormz:$URL_X:
according to https://github.com/wargio/naxsi/commit/5c933690de0b1325376aa9d57c2624de441ad809#diff-c255b088a4dee2f1282d1dccd609ed178431d1fa74815571342c6be2cde11cbcR196However I'm having troubles getting this to work.
WL rule:
BasicRule wl:1000 "mz:$URL:/|ANY";
Request:
Error log:
If I change the WL rule to the following (using ARGS instead of ANY):
BasicRule wl:1000 "mz:$URL:/|ARGS";
When I launch the same curl request, the id 1000 is not blocked anymore (naxsi now blocks an additional ID 1011).
When I whitelist both IDs using ARGS as target:
BasicRule wl:1000,1011 "mz:$URL:/|ARGS";
The curl request works:
But trying the same with ANY target won't work:
BasicRule wl:1000,1011 "mz:$URL:/|ANY";
Can you confirm or is there something else which needs to be done?