coreruleset: Since 4.2.0 many Fediverse ActivityPub pushes to /inbox fail with rule 941100, 932130, 932260 and others
Description
Since the update to CRS 4.2.0 I have a lot of false positives on rules 941100, 932130 or 932260.
I run owasp/modsecurity-crs in front of a Friendica server.
Logs
This is an example:
---D44GyDVQ---A--
[12/May/2024:02:28:16 +0200] 171547369645.268645 92.60.41.50 0 10.0.2.100 8080
---D44GyDVQ---B--
POST /inbox HTTP/1.1
Date: Sun, 12 May 2024 00:28:16 GMT
X-Forwarded-For: 92.60.41.50
User-Agent: http.rb/5.1.1 (Mastodon/4.2.8; +https://c.im/)
X-Forwarded-Proto: https
X-Forwarded-By: 10.88.0.7:8443
Content-Length: 751
X-Real-IP: 92.60.41.50
Digest: SHA-256=GKHv6FBSX2yWqioPpHeSCDAr+vn5xZKkDYKaoVT5m4E=
Host: fedi.0x42.ch
X-Forwarded-Port: 8443
Accept-Encoding: gzip
Forwarded: for=92.60.41.50; proto=https; by=10.88.0.7
Content-Type: application/activity+json
Signature: keyId="https://c.im/users/sitecollection#main-key",algorithm="rsa-sha256",headers="(request-target) host date digest content-type",signature="g6XAI/Pa4hcJQvnIgAlogJ5cyJWr3Dv2Cpp67qOvp9KQJ116E78ioJ5NIlapzw8rht1+t7H8tKF24Fazg9RJh6vQ+JnbvkZF+M+RnzbEiNcF8d3FLzQONfFB+lsBz9dtWN8B4v5bS/rmi9tZo4irHKrzC6PpH/vujdgazU7qf/IFzyy9tPTnXEAoNSuniEkUPm07n/EB8tLrIZPmClubtl1G3TfJ8/yiRQ3pp6avLaHHNcHejqNoTwR+Jp1nOeXJdabKPswquYPJV+Wzxh8sgv3Ln4oor+nsRCEw13SvuWzUVqm7BXe3rKa1ZKSCWPdvs805PWILCN6b2XSe3J7Rqw=="
---D44GyDVQ---C--
{"@context":"https://www.w3.org/ns/activitystreams","id":"https://c.im/users/sitecollection#delete","type":"Delete","actor":"https://c.im/users/sitecollection","to":["https://www.w3.org/ns/activitystreams#Public"],"object":"https://c.im/users/sitecollection","signature":{"type":"RsaSignature2017","creator":"https://c.im/users/sitecollection#main-key","created":"2024-05-12T00:25:23Z","signatureValue":"SMPaxxkHm6ejaJqS/lAouPJjRtMXmLfX/VBWuu6zTILQu7/gh18Vjlx2dqe/ktBqByQwkbRcdocOCiac6FOEtqvFTJaabUcl+z1NCwx9K9e+541DPYtouwI/6OUTe4BBtOL3eUC31iUosfmlKxgXI+loe7NFXcxc5RMt+Ma3iF9Rtf+QRkg9polMf0w65u/8LxWHI9xRHQsgdw95cJtxy/KnFxDc4zFqkHlBKCBaGHy4DeReGyzNEIheZB8tLyu7HM4zmYTlNfgd0qctARkBbydyVenVTCsHpj/lf2+nq9nNk3AToa5nM9FPet6kATd35ZF9auZQI40qoxb0o1+11g=="}}
---D44GyDVQ---E--
<html>\x0d\x0a<head><title>403 Forbidden</title></head>\x0d\x0a<body>\x0d\x0a<center><h1>403 Forbidden</h1></center>\x0d\x0a<hr><center>nginx</center>\x0d\x0a</body>\x0d\x0a</html>\x0d\x0a
---D44GyDVQ---F--
HTTP/1.1 403
Server: nginx
X-Robots-Tag: noindex, nofollow
Date: Sun, 12 May 2024 00:28:16 GMT
Content-Length: 146
X-Download-Options: noopen
Content-Type: text/html
Connection: keep-alive
Referrer-Policy: same-origin
Strict-Transport-Security: max-age=31536000; includeSubDomains
---D44GyDVQ---H--
ModSecurity: Warning. Matched "Operator `Rx' with parameter `(?i)(?:b[\"'\)\[\x5c]*(?:(?:(?:\|\||&&)[\s\x0b]*)?\$[!#\(\*\-0-9\?@_a-\{]*)?\x5c?u[\"'\)\[\x5c]*(?:(?:(?:\|\||&&)[\s\x0b]*)?\$[!#\(\*\-0-9\?@_a-\{]*)?\x5c?s[\"'\)\[\x5c]*(?:(?:(?:\|\||&&)[\s\x0b]*)?\$ (7508 characters omitted)' against variable `ARGS:json.signature.signatureValue' (Value: `SMPaxxkHm6ejaJqS/lAouPJjRtMXmLfX/VBWuu6zTILQu7/gh18Vjlx2dqe/ktBqByQwkbRcdocOCiac6FOEtqvFTJaabUcl+z1N (244 characters omitted)' ) [file "/etc/modsecurity.d/owasp-crs/rules/REQUEST-932-APPLICATION-ATTACK-RCE.conf"] [line "181"] [id "932235"] [rev ""] [msg "Remote Command Execution: Unix Command Injection (command without evasion)"] [data "Matched Data: enVTCsH found within ARGS:json.signature.signatureValue: SMPaxxkHm6ejaJqS/lAouPJjRtMXmLfX/VBWuu6zTILQu7/gh18Vjlx2dqe/ktBqByQwkbRcdocOCiac6FOEtqvFTJaabUcl+z1NCwx9K9e+541DPYtouwI/6OUTe4BBt (215 characters omitted)"] [severity "2"] [ver "OWASP_CRS/4.2.0"] [maturity "0"] [accuracy "0"] [tag "modsecurity"] [tag "application-multi"] [tag "language-shell"] [tag "platform-unix"] [tag "attack-rce"] [tag "paranoia-level/1"] [tag "OWASP_CRS"] [tag "capec/1000/152/248/88"] [tag "PCI/6.5.2"] [hostname "10.0.2.100"] [uri "/inbox"] [unique_id "171547369645.268645"] [ref "o281,7v30,344"]
ModSecurity: Access denied with code 403 (phase 2). Matched "Operator `Ge' with parameter `5' against variable `TX:BLOCKING_INBOUND_ANOMALY_SCORE' (Value: `5' ) [file "/etc/modsecurity.d/owasp-crs/rules/REQUEST-949-BLOCKING-EVALUATION.conf"] [line "222"] [id "949110"] [rev ""] [msg "Inbound Anomaly Score Exceeded (Total Score: 5)"] [data ""] [severity "0"] [ver "OWASP_CRS/4.2.0"] [maturity "0"] [accuracy "0"] [tag "modsecurity"] [tag "anomaly-evaluation"] [tag "OWASP_CRS"] [hostname "10.0.2.100"] [uri "/inbox"] [unique_id "171547369645.268645"] [ref ""]
---D44GyDVQ---I--
---D44GyDVQ---J--
---D44GyDVQ---K--
---D44GyDVQ---Z--
---P4CzUReS---A--
[12/May/2024:00:33:32 +0200] 171546681243.652535 202.61.242.89 0 10.0.2.100 8080
---P4CzUReS---B--
POST /inbox HTTP/1.1
Date: Sat, 11 May 2024 22:33:32 GMT
X-Forwarded-For: 202.61.242.89
User-Agent: http.rb/5.1.1 (Mastodon/4.2.8; +https://gametoots.de/)
X-Forwarded-Proto: https
X-Forwarded-By: 10.88.0.7:8443
Content-Length: 763
X-Real-IP: 202.61.242.89
Digest: SHA-256=eMS3mHbAjVbo1Y/ixAKZKpNrwGGPXl2RzSYT5Rg+82M=
Host: fedi.0x42.ch
X-Forwarded-Port: 8443
Accept-Encoding: gzip
Forwarded: for=202.61.242.89; proto=https; by=10.88.0.7
Content-Type: application/activity+json
Signature: keyId="https://gametoots.de/users/totorruns#main-key",algorithm="rsa-sha256",headers="(request-target) host date digest content-type",signature="V1xkz0vtpv7Nkjf6XrbaLWCwRVzIlHfVJlHGQ63AEFVzl4PDZSunmJbb23vlnwo6HuB0UZylv/NRQ6GGwA3yEqMhzdi3cNVGo2yqb7t1WbzWOwDetbWV39V3YLLq+d0cmzXYgHfjyVjpBkUPmeZmXFxC/l9mS2ZcRUpyBLCIdeEWQqi79Z8LM7b2jNrV5o4QbmlzvGjvFtZBOPc6ZXKhFhPIvDlvC1oo5qJZMB5BuNxEBAt629dQTdXXtQodiS8qMwV2CukPqqYFD0eLVMbv4QsV+bJK3GLutmEPr6uSe1rS5UPNe8KxaS1v25KrVW7gBQz72JeIdmbNgZRcidMhKg=="
---P4CzUReS---C--
{"@context":"https://www.w3.org/ns/activitystreams","id":"https://gametoots.de/users/totorruns#delete","type":"Delete","actor":"https://gametoots.de/users/totorruns","to":["https://www.w3.org/ns/activitystreams#Public"],"object":"https://gametoots.de/users/totorruns","signature":{"type":"RsaSignature2017","creator":"https://gametoots.de/users/totorruns#main-key","created":"2024-05-11T22:32:18Z","signatureValue":"p4COvrjMkdiRgUTAi/Pyi6CZO7+Zhm2SSt2hZrgq6tHgaqCk3IG9nPD6Uem9VxyaZ0xWvz/jQoGhrxhcRHxFBMCJOFHc6wpcB9dwdPG6T359R7QYvSEMBqT4sgHSv9yqw19h4K9Y/327TEC/HefUxdwR4XApugY4f5vigQ6ADyxNmyiQNQSi3VdTVBeXqK2ZpT3xwtqYHNopHkYbrcZoE32Q1O2CsFDptyvJc4PyZtJZ3BbVu1Y3pnnBa/CpBJA0RZjR1AHIC/ZEHGhmJsB6lEGDgPnwCy0jS946qIqCSjBKEyTCedy/IdTapZdelvboRo+ueosXZvPQAZoHgcc5vg=="}}
---P4CzUReS---E--
<html>\x0d\x0a<head><title>403 Forbidden</title></head>\x0d\x0a<body>\x0d\x0a<center><h1>403 Forbidden</h1></center>\x0d\x0a<hr><center>nginx</center>\x0d\x0a</body>\x0d\x0a</html>\x0d\x0a
---P4CzUReS---F--
HTTP/1.1 403
Server: nginx
X-Robots-Tag: noindex, nofollow
Date: Sat, 11 May 2024 22:33:32 GMT
Content-Length: 146
X-Download-Options: noopen
Content-Type: text/html
Connection: keep-alive
Referrer-Policy: same-origin
Strict-Transport-Security: max-age=31536000; includeSubDomains
---P4CzUReS---H--
ModSecurity: Warning. Matched "Operator `PmFromFile' with parameter `php-function-names-933150.data' against variable `ARGS:json.signature.signatureValue' (Value: `p4COvrjMkdiRgUTAi/Pyi6CZO7+Zhm2SSt2hZrgq6tHgaqCk3IG9nPD6Uem9VxyaZ0xWvz/jQoGhrxhcRHxFBMCJOFHc6wpcB9dw (244 characters omitted)' ) [file "/etc/modsecurity.d/owasp-crs/rules/REQUEST-933-APPLICATION-ATTACK-PHP.conf"] [line "279"] [id "933150"] [rev ""] [msg "PHP Injection Attack: High-Risk PHP Function Name Found"] [data "Matched Data: mkdir found within ARGS:json.signature.signatureValue: p4COvrjMkdiRgUTAi/Pyi6CZO7+Zhm2SSt2hZrgq6tHgaqCk3IG9nPD6Uem9VxyaZ0xWvz/jQoGhrxhcRHxFBMCJOFHc6wpcB9dwdPG6T359R7QYvSEMBqT4sgHSv9yqw19 (213 characters omitted)"] [severity "2"] [ver "OWASP_CRS/4.2.0"] [maturity "0"] [accuracy "0"] [tag "modsecurity"] [tag "application-multi"] [tag "language-php"] [tag "platform-multi"] [tag "attack-injection-php"] [tag "paranoia-level/1"] [tag "OWASP_CRS"] [tag "capec/1000/152/242"] [hostname "10.0.2.100"] [uri "/inbox"] [unique_id "171546681243.652535"] [ref "o7,5v30,344"]
ModSecurity: Access denied with code 403 (phase 2). Matched "Operator `Ge' with parameter `5' against variable `TX:BLOCKING_INBOUND_ANOMALY_SCORE' (Value: `5' ) [file "/etc/modsecurity.d/owasp-crs/rules/REQUEST-949-BLOCKING-EVALUATION.conf"] [line "222"] [id "949110"] [rev ""] [msg "Inbound Anomaly Score Exceeded (Total Score: 5)"] [data ""] [severity "0"] [ver "OWASP_CRS/4.2.0"] [maturity "0"] [accuracy "0"] [tag "modsecurity"] [tag "anomaly-evaluation"] [tag "OWASP_CRS"] [hostname "10.0.2.100"] [uri "/inbox"] [unique_id "171546681243.652535"] [ref ""]
---P4CzUReS---I--
---P4CzUReS---J--
---P4CzUReS---K--
---P4CzUReS---Z--
Your Environment
- CRS version (e.g., v3.3.4): 4.2.0
- Paranoia level setting (e.g. PL1) : 1
- ModSecurity version (e.g., 2.9.6): 3.0.12
- Web Server and version or cloud provider / CDN (e.g., Apache httpd 2.4.54): owasp/modsecurity-crs:nginx docker image
- Operating System and version: Debian Bookworm with Podman
Confirmation
[x] I have removed any personal data (email addresses, IP addresses, passwords, domain names) from any logs posted.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 16 (7 by maintainers)
Decisions taken in issue chat meeting on May 20 2024: