Closed CRS-migration-bot closed 3 years ago
User dune73 commented on date 2018-10-05 09:15:24:
Thank you fro your submission deepwather.
Here is my summary of your Alerts:
1 Requests triggered an XML parser error. That's either a broken XML file you are uploading, or it's a ModSec / libxml bug.
The rest as follows:
1 911100 Method is not allowed by policy
1 920240 URL Encoding Abuse Attack Attempt
1 930100 Path Traversal Attack (/../)
7 930110 Path Traversal Attack (/../)
911100: Misconfiguration. You should allow the PUT method
920240: Your XML refers to the following file: /files/%video/%0001-12-30T00:34:08+00:34:08 %video looks like a violation to me. If it is legit and standard nextcloud behaviour, which might very well be, we might have to look into it. But maybe it's just a crazy filename.
930100: Your payload is binary. That results in random data and rule alerts on short patterns like this. Maybe we need to disable critical rules like this. Other opinions welcome.
930110: Dito
User fzipi commented on date 2019-10-05 12:38:30:
dune73 Do you think is anything left to be done here?
User fzipi commented on date 2019-10-05 12:39:24:
deepwather We did not receive additional comments from you, so we will be closing this issue.
User dune73 commented on date 2019-10-05 12:43:19:
I did not follow this, so I can not really tell. The report came for 3.2, so I think it is still valid unless we really solved the 930100/10 FPs.
User g4laad commented on date 2020-01-22 10:59:49:
Good morning,
A colleague of mine and myself had the same issue as deepwather . We uploaded a simple text file with "../../../" in it. It directly trigerred rule id "930100".
Message: Warning. Pattern match "(?i)(?:\\x5c|(?:%(?:c(?:0%(?:[2aq]f|5c|9v)|1%(?:[19p]c|8s|af))|2(?:5(?:c(?:0%25af|1%259c)|2f|5c)|%46|f)|(?:(?:f(?:8%8)?0%8|e)0%80%a|bg%q)f|%3(?:2(?:%(?:%6|4)6|F)|5%%63)|u(?:221[56]|002f|EFC8|F025)|1u|5c)|0x(?:2f|5c)|\\/))(?:%(?:(?:f(?:(?:c%80|8)%8)?0%8 ..." at REQUEST_BODY. [file "/etc/httpd/modsecurity.d/rules/REQUEST-930-APPLICATION-ATTACK-LFI.conf"] [line "47"] [id "930100"] [msg "Path Traversal Attack (/../)"] [data "Matched Data: /../ found within REQUEST_BODY: ../../../"] [severity "CRITICAL"] [ver "OWASP_CRS/3.2.0"] [tag "application-multi"] [tag "language-multi"] [tag "platform-multi"] [tag "attack-lfi"] [tag "paranoia-level/1"] [tag "OWASP_CRS"] [tag "OWASP_CRS/WEB_ATTACK/DIR_TRAVERSAL"] Message: Warning. Operator GE matched 5 at TX:anomaly_score. [file "/etc/httpd/modsecurity.d/rules/REQUEST-949-BLOCKING-EVALUATION.conf"] [line "91"] [id "949110"] [msg "Inbound Anomaly Score Exceeded (Total Score: 5)"] [severity "CRITICAL"] [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/httpd/modsecurity.d/rules/RESPONSE-980-CORRELATION.conf"] [line "86"] [id "980130"] [msg "Inbound Anomaly Score Exceeded (Total Inbound Score: 5 - SQLI=0,XSS=0,RFI=0,LFI=5,RCE=0,PHPI=0,HTTP=0,SESS=0): individual paranoia level scores: 5, 0, 0, 0"] [tag "event-correlation"] Apache-Error: [file "apache2_util.c"] [line 271] [level 3] [client ] ModSecurity: Warning. Pattern match "(?i)(?:\\\\\\\\x5c|(?:%(?:c(?:0%(?:[2aq]f|5c|9v)|1%(?:[19p]c|8s|af))|2(?:5(?:c(?:0%25af|1%259c)|2f|5c)|%46|f)|(?:(?:f(?:8%8)?0%8|e)0%80%a|bg%q)f|%3(?:2(?:%(?:%6|4)6|F)|5%%63)|u(?:221[56]|002f|EFC8|F025)|1u|5c)|0x(?:2f|5c)|\\\\\\\\/))(?:%(?:(?:f(?:(?:c%80|8)%8)?0%8 ..." at REQUEST_BODY. [file "/etc/httpd/modsecurity.d/rules/REQUEST-930-APPLICATION-ATTACK-LFI.conf"] [line "47"] [id "930100"] [msg "Path Traversal Attack (/../)"] [data "Matched Data: /../ found within REQUEST_BODY: ../../../"] [severity "CRITICAL"] [ver "OWASP_CRS/3.2.0"] [tag "application-multi"] [tag "language-multi"] [tag "platform-multi"] [tag "attack-lfi"] [tag "paranoia-level/1"] [tag "OWASP_CRS"] [tag "OWASP_CRS/WEB_ATTACK/DIR_TRAVERSAL"] [hostname ""] [uri "/remote.php/webdav/bob.txt"] [unique_id "XignrKpWDIEh**Z5vg9SXWwAAAAM**"] Apache-Error: [file "apache2_util.c"] [line 271] [level 3] [client ] ModSecurity: Warning. Operator GE matched 5 at TX:anomaly_score. [file "/etc/httpd/modsecurity.d/rules/REQUEST-949-BLOCKING-EVALUATION.conf"] [line "91"] [id "949110"] [msg "Inbound Anomaly Score Exceeded (Total Score: 5)"] [severity "CRITICAL"] [tag "application-multi"] [tag "language-multi"] [tag "platform-multi"] [tag "attack-generic"] [hostname ""] [uri "/remote.php/webdav/bob.txt"] [unique_id "XignrKpWDIEh**Z5vg9SXWwAAAAM**"] Apache-Error: [file "apache2_util.c"] [line 271] [level 3] [client ] ModSecurity: Warning. Operator GE matched 5 at TX:inbound_anomaly_score. [file "/etc/httpd/modsecurity.d/rules/RESPONSE-980-CORRELATION.conf"] [line "86"] [id "980130"] [msg "Inbound Anomaly Score Exceeded (Total Inbound Score: 5 - SQLI=0,XSS=0,RFI=0,LFI=5,RCE=0,PHPI=0,HTTP=0,SESS=0): individual paranoia level scores: 5, 0, 0, 0"] [tag "event-correlation"] [hostname ""] [uri "/remote.php/webdav/bob.txt"] [unique_id "XignrKpWDIEh**Z5vg9SXWwAAAAM**"] Apache-Handler: proxy-server Stopwatch: 1579689900014668 249880 (- - -) Stopwatch2: 1579689900014668 249880; combined=3941, p1=868, p2=2456, p3=94, p4=279, p5=243, sr=125, sw=1, l=0, gc=0 Response-Body-Transformed: Dechunked Producer: ModSecurity for Apache/2.9.2 (http://www.modsecurity.org/); OWASP_CRS/3.2.0. Server: Apache/2.4.6 (CentOS) Engine-Mode: "DETECTION_ONLY"
After adding deepwather rule in the Nextcloud ruleset, Everything worked like a charm !
Same here:
ModSecurity: Warning. Matched "Operator
Eq' with parameter 0' against variable
REQBODY_ERROR' (Value: 1' ) [file "/etc/apache2/modsecurity.d/modsecurity.conf"] [line "53"] [id "200002"] [rev ""] [msg "Failed to parse request body."] [data "XML parsing error: XML: Failed parsing document."] [severity "2"] [ver ""] [maturity "0"] [accuracy "0"] [hostname "******"] [uri "/remote.php/dav/files/********/"] [unique_id "159216500842.878630"] [ref "v1334,1"]
Exclusion rules for Nextcloud are on.
Environment
This issue has been open 120 days with no activity. Remove the stale label or comment, or this will be closed in 14 days
Are you having problem also with newest Nextcloud exclusion rules package? https://raw.githubusercontent.com/coreruleset/coreruleset/v3.4/dev/rules/REQUEST-903.9003-NEXTCLOUD-EXCLUSION-RULES.conf
@DavidOsipov, are you still interested in helping us to fix this issue? We lack some information and if we don't get it, we'll have to close this issue.
Not sure if the same issue or not, but I cannot for the life of me get Nextcloud to load files/calendar/tasks/probably_more with CRS.
/var/log/modsec_audit.log
:
...
---ZBqaPVHS---B--
GET /nextcloud/apps/user_status/heartbeat HTTP/2.0
referer: my_domain/nextcloud/apps/user_status/heartbeat
content-type: application/json;charset=utf-8
origin: my_domain
dnt: 1
accept-encoding: gzip, deflate, br
content-length: 19
te: trailers
accept: application/json, text/plain, */*
sec-gpc: 1
host: my_domain
---ZBqaPVHS---H--
ModSecurity: Warning. Matched "Operator `Rx' with parameter `^0?$' against variable `REQUEST_HEADERS:content-length' (Value: `19' ) [file "/usr/local/coreruleset-3.3.0/rules/REQUEST-920-PROTOCOL-ENFORCEMENT.conf"] [line "161"] [id "920170"] [rev ""] [msg "GET or HEAD Request with Body Content"] [data "19"] [severity "2"] [ver "OWASP_CRS/3.3.0"] [maturity "0"] [accuracy "0"] [tag "application-multi"] [tag "language-multi"] [tag "platform-multi"] [tag "attack-protocol"] [tag "paranoia-level/1"] [tag "OWASP_CRS"] [tag "capec/1000/210/272"] [hostname "redacted_lan_ip"] [uri "/nextcloud/apps/user_status/heartbeat"] [unique_id "in_reverse_order"] [ref "o0,3v0,3v508,2"]
ModSecurity: Access denied with code 200 (phase 2). Matched "Operator `Ge' with parameter `5' against variable `TX:ANOMALY_SCORE' (Value: `5' ) [file "/usr/local/coreruleset-3.3.0/rules/REQUEST-949-BLOCKING-EVALUATION.conf"] [line "80"] [id "949110"] [rev ""] [msg "Inbound Anomaly Score Exceeded (Total Score: 5)"] [data ""] [severity "2"] [ver "OWASP_CRS/3.3.0"] [maturity "0"] [accuracy "0"] [tag "application-multi"] [tag "language-multi"] [tag "platform-multi"] [tag "attack-generic"] [hostname "redacted_lan_ip"] [uri "/nextcloud/apps/user_status/heartbeat"] [unique_id "can_you_tell_I_did_these"] [ref ""]
...
---MWqIrNr7---B--
GET /nextcloud/apps/user_status/heartbeat HTTP/2.0
referer: my_domain/nextcloud/apps/user_status/heartbeat
content-type: application/json;charset=utf-8
origin: my_domain
dnt: 1
accept-encoding: gzip, deflate, br
content-length: 19
te: trailers
accept: application/json, text/plain, */*
sec-gpc: 1
host: my_domain
---MWqIrNr7---H--
ModSecurity: Warning. Matched "Operator `Rx' with parameter `^0?$' against variable `REQUEST_HEADERS:content-length' (Value: `19' ) [file "/usr/local/coreruleset-3.3.0/rules/REQUEST-920-PROTOCOL-ENFORCEMENT.conf"] [line "161"] [id "920170"] [rev ""] [msg "GET or HEAD Request with Body Content"] [data "19"] [severity "2"] [ver "OWASP_CRS/3.3.0"] [maturity "0"] [accuracy "0"] [tag "application-multi"] [tag "language-multi"] [tag "platform-multi"] [tag "attack-protocol"] [tag "paranoia-level/1"] [tag "OWASP_CRS"] [tag "capec/1000/210/272"] [hostname "redacted_lan_ip"] [uri "/nextcloud/apps/user_status/heartbeat"] [unique_id "did_I_really_copy_this_much_text"] [ref "o0,3v0,3v508,2"]
ModSecurity: Access denied with code 200 (phase 2). Matched "Operator `Ge' with parameter `5' against variable `TX:ANOMALY_SCORE' (Value: `5' ) [file "/usr/local/coreruleset-3.3.0/rules/REQUEST-949-BLOCKING-EVALUATION.conf"] [line "80"] [id "949110"] [rev ""] [msg "Inbound Anomaly Score Exceeded (Total Score: 5)"] [data ""] [severity "2"] [ver "OWASP_CRS/3.3.0"] [maturity "0"] [accuracy "0"] [tag "application-multi"] [tag "language-multi"] [tag "platform-multi"] [tag "attack-generic"] [hostname "redacted_local_ip"] [uri "/nextcloud/apps/user_status/heartbeat"] [unique_id "it_never_ends"] [ref ""]
...
---jItMAN3H---B--
GET /nextcloud/apps/user_status/heartbeat HTTP/2.0
referer: my_domain/nextcloud/apps/user_status/heartbeat
content-type: application/json;charset=utf-8
origin: my_domain
dnt: 1
accept-encoding: gzip, deflate, br
content-length: 19
te: trailers
accept: application/json, text/plain, */*
sec-gpc: 1
host: my_domain
---jItMAN3H---H--
ModSecurity: Warning. Matched "Operator `Rx' with parameter `^0?$' against variable `REQUEST_HEADERS:content-length' (Value: `19' ) [file "/usr/local/coreruleset-3.3.0/rules/REQUEST-920-PROTOCOL-ENFORCEMENT.conf"] [line "161"] [id "920170"] [rev ""] [msg "GET or HEAD Request with Body Content"] [data "19"] [severity "2"] [ver "OWASP_CRS/3.3.0"] [maturity "0"] [accuracy "0"] [tag "application-multi"] [tag "language-multi"] [tag "platform-multi"] [tag "attack-protocol"] [tag "paranoia-level/1"] [tag "OWASP_CRS"] [tag "capec/1000/210/272"] [hostname "redacted_lan_ip"] [uri "/nextcloud/apps/user_status/heartbeat"] [unique_id "really_sick_of_this"] [ref "o0,3v0,3v508,2"]
ModSecurity: Access denied with code 200 (phase 2). Matched "Operator `Ge' with parameter `5' against variable `TX:ANOMALY_SCORE' (Value: `5' ) [file "/usr/local/coreruleset-3.3.0/rules/REQUEST-949-BLOCKING-EVALUATION.conf"] [line "80"] [id "949110"] [rev ""] [msg "Inbound Anomaly Score Exceeded (Total Score: 5)"] [data ""] [severity "2"] [ver "OWASP_CRS/3.3.0"] [maturity "0"] [accuracy "0"] [tag "application-multi"] [tag "language-multi"] [tag "platform-multi"] [tag "attack-generic"] [hostname "redacted_lan_ip"] [uri "/nextcloud/apps/user_status/heartbeat"] [unique_id "big_output"] [ref ""]
...
---Oy9Du1bT---B--
GET /nextcloud/apps/user_status/heartbeat HTTP/2.0
referer: my_domain/nextcloud/apps/user_status/heartbeat
content-type: application/json;charset=utf-8
origin: my_domain
dnt: 1
accept-encoding: gzip, deflate, br
content-length: 19
te: trailers
accept: application/json, text/plain, */*
sec-gpc: 1
host: my_domain
---Oy9Du1bT---H--
ModSecurity: Warning. Matched "Operator `Rx' with parameter `^0?$' against variable `REQUEST_HEADERS:content-length' (Value: `19' ) [file "/usr/local/coreruleset-3.3.0/rules/REQUEST-920-PROTOCOL-ENFORCEMENT.conf"] [line "161"] [id "920170"] [rev ""] [msg "GET or HEAD Request with Body Content"] [data "19"] [severity "2"] [ver "OWASP_CRS/3.3.0"] [maturity "0"] [accuracy "0"] [tag "application-multi"] [tag "language-multi"] [tag "platform-multi"] [tag "attack-protocol"] [tag "paranoia-level/1"] [tag "OWASP_CRS"] [tag "capec/1000/210/272"] [hostname "redacted_lan_ip"] [uri "/nextcloud/apps/user_status/heartbeat"] [unique_id "getting_bored"] [ref "o0,3v0,3v508,2"]
ModSecurity: Access denied with code 200 (phase 2). Matched "Operator `Ge' with parameter `5' against variable `TX:ANOMALY_SCORE' (Value: `5' ) [file "/usr/local/coreruleset-3.3.0/rules/REQUEST-949-BLOCKING-EVALUATION.conf"] [line "80"] [id "949110"] [rev ""] [msg "Inbound Anomaly Score Exceeded (Total Score: 5)"] [data ""] [severity "2"] [ver "OWASP_CRS/3.3.0"] [maturity "0"] [accuracy "0"] [tag "application-multi"] [tag "language-multi"] [tag "platform-multi"] [tag "attack-generic"] [hostname "redacted_lan_ip"] [uri "/nextcloud/apps/user_status/heartbeat"] [unique_id "just_in_case"] [ref ""]
...
---CR3awI0I---B--
GET /nextcloud/remote.php/dav/ HTTP/2.0
depth: 0
origin: my_domain
dnt: 1
x-nc-caldav-webcal-caching: On
referer: my_domain/nextcloud/remote.php/dav/
content-type: application/xml; charset=utf-8
x-requested-with: XMLHttpRequest
te: trailers
accept: */*
sec-gpc: 1
host: my_domain
content-length: 90
---CR3awI0I---H--
ModSecurity: Warning. Matched "Operator `Rx' with parameter `^0?$' against variable `REQUEST_HEADERS:content-length' (Value: `90' ) [file "/usr/local/coreruleset-3.3.0/rules/REQUEST-920-PROTOCOL-ENFORCEMENT.conf"] [line "161"] [id "920170"] [rev ""] [msg "GET or HEAD Request with Body Content"] [data "90"] [severity "2"] [ver "OWASP_CRS/3.3.0"] [maturity "0"] [accuracy "0"] [tag "application-multi"] [tag "language-multi"] [tag "platform-multi"] [tag "attack-protocol"] [tag "paranoia-level/1"] [tag "OWASP_CRS"] [tag "capec/1000/210/272"] [hostname "redacted_lan_ip"] [uri "/nextcloud/remote.php/dav/"] [unique_id "um_what"] [ref "o0,3v0,3v529,2"]
ModSecurity: Access denied with code 200 (phase 2). Matched "Operator `Ge' with parameter `5' against variable `TX:ANOMALY_SCORE' (Value: `5' ) [file "/usr/local/coreruleset-3.3.0/rules/REQUEST-949-BLOCKING-EVALUATION.conf"] [line "80"] [id "949110"] [rev ""] [msg "Inbound Anomaly Score Exceeded (Total Score: 5)"] [data ""] [severity "2"] [ver "OWASP_CRS/3.3.0"] [maturity "0"] [accuracy "0"] [tag "application-multi"] [tag "language-multi"] [tag "platform-multi"] [tag "attack-generic"] [hostname "redacted_lan_ip"] [uri "/nextcloud/remote.php/dav/"] [unique_id "numbers_go_here"] [ref ""]
...
And just for convenience, I'll list the rule IDs from each line here:
This probably isn't as important, but here are the REQUEST-*.conf rules I Include:
901, 903.9003, 905, 910-912, 920, 921, 930-933, 941-943, 949, 950-954, 959, 980
And finally, I have these lines in my crs-setup.conf
SecRule REQUEST_URI "@beginsWith /nextcloud/" setvar:tx.crs_exclusions_nextcloud=1 \
"id:900130,\
phase:1,\
nolog,\
pass,\
t:none"
@Magicrafter13 All those requests are GET
, but they include some payload which is not what you want. You need to use POST/PUT/PATCH
.. practically anything but GET/HEAD
for that.
Maybe you can add the C
part of logging to see what is going on. You can add it globally with
# Log everything we know about a transaction.
SecAuditLogParts ABCIJDEFHZ
Or locally for example editing that rule and add +C
:
SecRule REQUEST_URI "@beginsWith /nextcloud/" setvar:tx.crs_exclusions_nextcloud=1 \
"id:900130,\
phase:1,\
nolog,\
ctl:auditLogParts=+C,\
pass,\
t:none"
But in the end, I think this might be another bug in nextcloud...
We talked about this in the April issue chat. Here is our conclusion:
This issue is probably depending on a Nextcloud bug. We are adding this to the general project to rewrite the entire Nextcloud rule exclusion set discussed here.
Issue originally created by user deepwather on date 2018-10-05 08:44:16. Link to original issue: https://github.com/SpiderLabs/owasp-modsecurity-crs/issues/1197.
Type of Issue
Bug fix of Nextcloud exclusions -> (false positives)
Description
Nextcloud exclusions is enabled in configuration as follwing:
Now when I try to upload files to Nextcloud or use the online txt-editor over the web-UI; The follwing "Path Traversal Attack" false positives happen.
The problem here is, that nextcloud uses four various paths for the file-upload: ->> The paths are: "/remote.php/webdav/" | "/public.php/webdav/" | "/remote.php/dav/" AND "/public.php/dav/" ->> here happens the False positive.
log entry.
My temporary soulution was to switch off the responseBodyAccess of thous paths:
Your Environment
Confirmation
[X] I have removed any personal data (email addresses, IP addresses, passwords, domain names) from any logs posted.