-
-
Notifications
You must be signed in to change notification settings - Fork 402
941310 - Double escape and problem with german ü #2171
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
Comments
Hi @stefanpinter, thanks for your report. Could you show us your request with Btw it's interesting that you have two lines with same
Thank you. |
hi! Github is adding backslashes like crazy... The rule only has one backslash before each xbc and each xbe, which make it stand for some special symbols: but it actually matches against this: i understand that this might be intentional somehow in this XSS context? can you confirm this? |
hi @stefanpinter,
That's correct.
Do you see this pattern in your log? If yes, that's because Apache escapes the
No, I'm not sure this one. If your application works only from browser, you can press CTRL+SHIFT+I, and check the Network tab. There you can see the requests. If you choose the correct one, and select it by the right button, there will be an option: Copy -> Copy as cURL. Remove the sensitive data, and please share that request with us. It would be good to see the whole request (including headers). |
with the generated curl command it goes through fine it seems `* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
|
These are just the TLS negotiation phase, we have to see the whole request, including headers. The command itself would be the best. For eg.:
|
Hi! Oh, you are right. curl was waiting for some resonse because I had the score threshold at 5000. (link deleted) |
Link is already gone. :( When you put things in triple backticks, GH should not add any additional backslashes. |
Hi dune73! (link deleted) |
Thanks @stefanpinter. Here is the condensed minimal request (30min of work):
|
So we have |
hi @dune73 I can at least confirm that this does the same: `--12fd9040-A-- --12fd9040-C-- --12fd9040-E-- <title>403 Forbidden</title>ForbiddenYou don't have permission to access this resource. --12fd9040-H-- |
Thanks for the confirmation. No, this is not for you. It's for us. If we want to fix this, we need to be able to test this. That's why I took the time to condense your payload to the minimal payload that triggers the alert. Now we have that and we can go about fixing this. Or we decide to leave it, since the In the meantime or if we leave it open, you should write a rule exclusion for this particular case. See the tutorials at https://netnea.com to learn how to do that. |
I also got false positive from this rule with khmer unicode UTF8: ើ (%E1%9E%BE). |
Thank you for reporting @Kendokai. This is highly welcome since we get very few report about non-Western language false positive. Can you tell me more about your setup and could you provide a full curl call that triggers this rule (see above)? |
Issue covered in the September issue chat. @franbuehler volunteered to check if this is indeed already solved, including the Russian and Khmer findings. |
@dune73
|
Thank you @Kendokai. |
As promised I tested this FP with the curl call I will close this issue here. Please open a new one if you think this will not be resolved or if you think it's not resolved by the current dev branch. |
From reading the issue the fix has been added to a 3.4/dev branch? ok but where I can find it and where can I add it. The German "ü" issue still exist in the latest official release and users need a not-dev-branch fix to make mod_security2 work on German sites. |
@diqidoq You can find it here: |
btw still a problem on ubuntu 22 with installed modsecurity-crs package, which brings 3.3.2-1 =( |
You are totally right. Unfortunately, Ubuntu and Debian refuse to upgrade to latest releases (even in the 3.3 release line). We're at it, but it's not going anywhere. If you prefer packages, then I suggest you check out https://modsecurity.digitalwave.hu/. Ervin Hegedüs / @airween who is providing these is also providing the official debian / ubuntu packages (they are just not picking them up). |
just to make sure, i got you correct. this repo "replaces" modsecurity-crs so that i can uninstall modsecurity-crs? |
Hi @chrisi51,
you don't need to uninstall that package. If you set up Digitalwave's repository and do an upgrade your system will upgrade your existing owasp-modsecurity-crs package to 3.3.5. Please be careful which packages you allow to install from that repository! |
Uh oh!
There was an error while loading. Please reload this page.
Description
Hi!
The rule says this:
SecRule REQUEST_COOKIES|!REQUEST_COOKIES:/__utm/|REQUEST_COOKIES_NAMES|ARGS_NAMES|ARGS|XML:/* "@rx \xbc[^\xbe>]*[\xbe>]|<[^\xbe]*\xbe" \
But it actually matches this:
\\xbc[^\\\\xbe>][\\xbe>]|<[^\\\\xbe]\\xbe
Why? This makes it match our string "Gültigkeit" which encoded looks like this "G\xbcltigkeit"
Audit Logs / Triggered Rule Numbers
941310
--3234e523-H-- Message: Warning. Pattern match "\\xbc[^\\xbe>]*[\\xbe>]|<[^\\xbe]*\\xbe" at ARGS:offerData. [file "/etc/apache2/modsecurity-crs/coreruleset-3.3.2/rules/REQUEST-941-APPLICATION-ATTACK-XSS.conf"] [line "546"] [id "941310"] [msg "US-ASCII Malformed Encoding XSS Filter - Attack Detected"] [data "Matched Data: \xbcltigkeit in tagen\x22},{\x22einstellungs_id\x22:30,\x22gruppierung\x22:\x22angebotkv\x22,\x22art\x22:\x22mandant\x22,\x22key\x22:\x22kauf_gueltigkeitsdauer\x22,\x22value\x22:\x2228\x22,\x22type\x22:\x22text\x22,\x22options\x22:null,\x22default\x22:\x2214\x22,\x22hilfetext\x22:null,\x22wartbar\x22:\x221\x22,\x22marke_id\x22:0,\x22datum_anlage\x22:\x2223.10.2014 15:06\x22,\x22datum_bearbeitung\x22:\x2223.10.2014 15:06\x22,\x22benutzer_anlage\x22:6,\x22benutzer_bearbeitung\x22:6,\x22bezeic..."] [severity "CRITICAL"] [ver "OWASP_CRS/3.3.2"] [tag "application-multi"] [tag "language-multi"] [tag "platform-tomcat"] [tag "attack-xss"] [tag "paranoia-level/1"] [tag "OWASP_CRS"] [tag "capec/1000/152/242"] Message: Warning. Pattern match "(?i:(?:[\"'
](?:;?\s*?(?:having|select|union)\b\s*?[^\\s]|\s*?!\s*?"'\\w])|(?:c(?:onnection_id|urrent_user)|database)\\s*?\\([^\\)]*?|u(?:nion(?:[\\w(\\s]*?select| select @)|ser\\s*?\\([^\\)]*?)|s(?:chema\\s*?\\([^\\)]*?|elect.*?\\w?user\\()|in ..." at ARGS:offerData. [file "/etc/apache2/modsecurity-crs/coreruleset-3.3.2/rules/REQUEST-942-APPLICATION-ATTACK-SQLI.conf"] [line "183"] [id "942190"] [msg "Detects MSSQL code execution and information gathering attempts"] [data "Matched Data: \x22select\x22 found within ARGS:offerData: {\x22id\x22:3377,\x22mandant_id\x22:67,\x22offer_type_id\x22:1,\x22offer_calculationtype_id\x22:1,\x22offer_businesscase_id\x22:1,\x22offer_status_id\x22:1,\x22kontakt_id\x22:219805,\x22kundengruppe\x22:\x22B2C\x22,\x22offer_name\x22:\x22\x22,\x22gewaehrleistung\x22:\x22\x22,\x22garantie\x22:\x22\x22,\x22bemerkung_intern\x22:\x22\x22,\x22bemerkung_extern\x22:\x22\x22,\x22offer_reference_number\x22:202101233,\x22offer_reference_external\x22:\x22\x2..." Message: Rule 7f3211923618 [id "942240"][file "/etc/apache2/modsecurity-crs/coreruleset-3.3.2/rules/REQUEST-942-APPLICATION-ATTACK-SQLI.conf"][line "254"] - Execution error - PCRE limits exceeded (-8): (null). Message: Access denied with code 403 (phase 2). Operator GE matched 5 at TX:anomaly_score. [file "/etc/apache2/modsecurity-crs/coreruleset-3.3.2/rules/REQUEST-949-BLOCKING-EVALUATION.conf"] [line "93"] [id "949110"] [msg "Inbound Anomaly Score Exceeded (Total Score: 10)"] [severity "CRITICAL"] [ver "OWASP_CRS/3.3.2"] [tag "application-multi"] [tag "language-multi"] [tag "platform-multi"] [tag "attack-generic"] Message: Warning. Operator GE matched 5 at TX:inbound_anomaly_score. [file "/etc/apache2/modsecurity-crs/coreruleset-3.3.2/rules/RESPONSE-980-CORRELATION.conf"] [line "91"] [id "980130"] [msg "Inbound Anomaly Score Exceeded (Total Inbound Score: 10 - SQLI=5,XSS=5,RFI=0,LFI=0,RCE=0,PHPI=0,HTTP=0,SESS=0): individual paranoia level scores: 10, 0, 0, 0"] [ver "OWASP_CRS/3.3.2"] [tag "event-correlation"] Apache-Error: [file "apache2_util.c"] [line 273] [level 3] [client 62.47.98.110] ModSecurity: Warning. Pattern match "\\\\\\\\xbc[^\\\\\\\\xbe>]*[\\\\\\\\xbe>]|<[^\\\\\\\\xbe]*\\\\\\\\xbe" at ARGS:offerData. [file "/etc/apache2/modsecurity-crs/coreruleset-3.3.2/rules/REQUEST-941-APPLICATION-ATTACK-XSS.conf"] [line "546"] [id "941310"] [msg "US-ASCII Malformed Encoding XSS Filter - Attack Detected"] [data "Matched Data: \\\\xbcltigkeit in tagen\\\\x22},{\\\\x22einstellungs_id\\\\x22:30,\\\\x22gruppierung\\\\x22:\\\\x22angebotkv\\\\x22,\\\\x22art\\\\x22:\\\\x22mandant\\\\x22,\\\\x22key\\\\x22:\\\\x22kauf_gueltigkeitsdauer\\\\x22,\\\\x22value\\\\x22:\\\\x2228\\\\x22,\\\\x22type\\\\x22:\\\\x22text\\\\x22,\\\\x22options\\\\x22:null,\\\\x22default\\\\x22:\\\\x2214\\\\x22,\\\\x22hilfetext\\\\x22:null,\\\\x22wartbar\\\\x22:\\\\x221\\\\x22,\\\\x22marke_id\\\\x22:0,\\\\x22datum_anlage\\\\x22:\\\\x2223.10.2014 15:06\\\\x22,\\\\x22datum_bearbeitung\\\\x22:\\\\x2223.10.2014 15:06\\\\x22,\\\\x22benutzer_anlage\\\\x22:6,\\\\x22benutzer_bearbeitung\\\\x22:6,\\\\x22bezeic..."] [severity "CRITICAL"] [ver "OWASP_CRS/3.3.2"] [tag "application-multi"] [tag "language-multi"] [tag "platform-tomcat"] [tag "attack-xss"] [tag "paranoia-level/1"] [tag "OWASP_CRS"] [tag "capec/1000/152/242"] [hostname "snipped"] [uri "/crm/dokumente/dokument_pdf/3337373737366535353835306130356139626434656263353362333433336438656161366435333863326231333832393532386230356264316230366531313361626637383234646332656165333266623137373536666430363866646339386531643366333565623434373665613863653765633462313965646164656466553950746a52326473415a78475255666e6e726f706f4e304b415676626b44486373427254706d495453633d"] [unique_id "YQqJyNBZrnK0t4Z4Vmz6@AAAAAQ"] Apache-Error: [file "apache2_util.c"] [line 273] [level 3] [client 62.47.98.110] ModSecurity: Warning. Pattern match "(?i:(?:[\\\\"'
|(?:c(?:onnection_id|urrent_user)|database)\\\\s*?\\\\([^\\\\\\\\)]?|u(?:nion(?:[\\\\w(\\\\s]?select| select @)|ser\\\\s*?\\\\([^\\\\\\\\)]?)|s(?:chema\\\\s?\\\\([^\\\\\\\\)]?|elect.?\\\\w?user\\\\()|in ..." at ARGS:offerData. [file "/etc/apache2/modsecurity-crs/coreruleset-3.3.2/rules/REQUEST-942-APPLICATION-ATTACK-SQLI.conf"] [line "183"] [id "942190"] [msg "Detects MSSQL code execution and information gathering attempts"] [data "Matched Data: \\x22select\\x22 found within ARGS:offerData: {\\x22id\\x22:3377,\\x22mandant_id\\x22:67,\\x22offer_type_id\\x22:1,\\x22offer_calculationtype_id\\x22:1,\\x22offer_businesscase_id\\x22:1,\\x22offer_status_id\\x22:1,\\x22kontakt_id\\x22:219805,\\x22kundengruppe\\x22:\\x22B2C\\x22,\\x22offer_name\\x22:\\x22\\x22,\\x22gewaehrleistung\\x22:\\x22\\x22,\\x22garantie\\x22:\\x22\\x22,\\x22bemerkung_intern\\x22:\\x22\\x22,\\x22bemerkung_extern\\x22:\\x22\\x22,\\x22offer_reference_number\\x22:202101233,\\x22offer_reference_external\\x22:\\x22\\x2..." [hostname "snipped"] [uri "/crm/dokumente/dokument_pdf/3337373737366535353835306130356139626434656263353362333433336438656161366435333863326231333832393532386230356264316230366531313361626637383234646332656165333266623137373536666430363866646339386531643366333565623434373665613863653765633462313965646164656466553950746a52326473415a78475255666e6e726f706f4e304b415676626b44486373427254706d495453633d"] [unique_id "YQqJyNBZrnK0t4Z4Vmz6@AAAAAQ"]Apache-Error: [file "apache2_util.c"] [line 273] [level 3] [client 62.47.98.110] ModSecurity: Rule 7f3211923618 [id "942240"][file "/etc/apache2/modsecurity-crs/coreruleset-3.3.2/rules/REQUEST-942-APPLICATION-ATTACK-SQLI.conf"][line "254"] - Execution error - PCRE limits exceeded (-8): (null). [hostname "snipped"] [uri "/crm/dokumente/dokument_pdf/3337373737366535353835306130356139626434656263353362333433336438656161366435333863326231333832393532386230356264316230366531313361626637383234646332656165333266623137373536666430363866646339386531643366333565623434373665613863653765633462313965646164656466553950746a52326473415a78475255666e6e726f706f4e304b415676626b44486373427254706d495453633d"] [unique_id "YQqJyNBZrnK0t4Z4Vmz6@AAAAAQ"]
Apache-Error: [file "apache2_util.c"] [line 273] [level 3] [client 62.47.98.110] ModSecurity: Access denied with code 403 (phase 2). Operator GE matched 5 at TX:anomaly_score. [file "/etc/apache2/modsecurity-crs/coreruleset-3.3.2/rules/REQUEST-949-BLOCKING-EVALUATION.conf"] [line "93"] [id "949110"] [msg "Inbound Anomaly Score Exceeded (Total Score: 10)"] [severity "CRITICAL"] [ver "OWASP_CRS/3.3.2"] [tag "application-multi"] [tag "language-multi"] [tag "platform-multi"] [tag "attack-generic"] [hostname "snipped"] [uri "/crm/dokumente/dokument_pdf/3337373737366535353835306130356139626434656263353362333433336438656161366435333863326231333832393532386230356264316230366531313361626637383234646332656165333266623137373536666430363866646339386531643366333565623434373665613863653765633462313965646164656466553950746a52326473415a78475255666e6e726f706f4e304b415676626b44486373427254706d495453633d"] [unique_id "YQqJyNBZrnK0t4Z4Vmz6@AAAAAQ"]
Apache-Error: [file "apache2_util.c"] [line 273] [level 3] [client 62.47.98.110] ModSecurity: Warning. Operator GE matched 5 at TX:inbound_anomaly_score. [file "/etc/apache2/modsecurity-crs/coreruleset-3.3.2/rules/RESPONSE-980-CORRELATION.conf"] [line "91"] [id "980130"] [msg "Inbound Anomaly Score Exceeded (Total Inbound Score: 10 - SQLI=5,XSS=5,RFI=0,LFI=0,RCE=0,PHPI=0,HTTP=0,SESS=0): individual paranoia level scores: 10, 0, 0, 0"] [ver "OWASP_CRS/3.3.2"] [tag "event-correlation"] [hostname "snipped"] [uri "/crm/dokumente/dokument_pdf/3337373737366535353835306130356139626434656263353362333433336438656161366435333863326231333832393532386230356264316230366531313361626637383234646332656165333266623137373536666430363866646339386531643366333565623434373665613863653765633462313965646164656466553950746a52326473415a78475255666e6e726f706f4e304b415676626b44486373427254706d495453633d"] [unique_id "YQqJyNBZrnK0t4Z4Vmz6@AAAAAQ"]`
Your Environment
Confirmation
[x] I have removed any personal data (email addresses, IP addresses,
passwords, domain names) from any logs posted.
The text was updated successfully, but these errors were encountered: