-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Multimatch rule hits have msg and data fields empty in audit logs #2573
Comments
Hi @Sachin-M-Desai , Thank you for the report. I am able to reproduce that effect in It looks like there is a fix for this in the (in-progress) 3.1 branch. |
Thank you so much for looking into it. Could you help us know when the fix or a potential fix might be available? |
The timing on that being available in v3/master is uncertain. |
Dont mind helping out to test any patch either if available early. Thanks again. |
This functionality became broken as a side effect of: |
A fix for this is available in the related pull request for either use or testing. Since some of the audit logging logic has proven to be fragile, I will hold off on merging it for at least a week or two to allow more time for verification. |
Describe the bug
For rules that have been tagged with "multimatch", the audit logs are incomplete. Example below of rule 942130, the msg and data fields are empty. The issue is generic to all the rules tagged with "multimatch".
ModSecurity: Warning. Matched "Operator
Rx' with parameter
(?i:[\s'"()]*?\b([\d\w]+)\b[\s'\"
()]?(?:<(?:=(?:[\s'"()]*?(?!\b\1\b)[\d\w]+|>[\s'\"
()]?(?:\b\1\b))|>?[\s'"()]*?(?!\b\1\b)[\d\w]+)|(?:not\s+(?:regexp|like)|is\s+not|>=?|!=|\^)[\s'\"
()]*?(?!\ (78 characters omitted)' against variableARGS:json.comment' (Value:
The taste of the juice is not good. {{js-email}} ' ) [file "/usr/local/appsentinels-onprem/config/policies/shop1/waf/rules/REQUEST-942-APPLICATION-ATTACK-SQLI.conf"] [line "621"] [id "942130"] [rev ""] [msg ""] [data ""] [severity "0"][ver "OWASP_CRS/3.2.0"] [maturity "0"] [accuracy "0"] [hostname "172.20.0.5"] [uri "/api/Feedbacks/8"] [unique_id "1622108344"] [ref "o17,18o18,5v13,50"]
The issue is not seen if the multimatch field is taken off the rule. All is well then.
Logs and dumps
Output of:
DebugLogs (level 9)
modsec_debug.log
AuditLogs
modsec_audit.log
To Reproduce
Steps to reproduce the behavior:
Configure in detectiononly mode and run the below sample curl command,
curl -i -X POST -H 'Content-type: application/json' http://XXXXXXXX:XXXX/api/Feedbacks/8 -d '{"captcha":"14","rating":3,"captchaId":0,"comment":" The taste of the juice is not good. {{js-email}} ","UserId":39}'
Expected behavior
msg field should have been populated with "SQL Injection Attack: SQL Tautology Detected"
Server (please complete the following information):
Rule Set (please complete the following information):
The text was updated successfully, but these errors were encountered: