Behavior change in regex macro expansion from 2.9.7 to 2.9.8 affecting CRS 3.2.x and 3.3.x
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
Comienza revisando PR #2357 y el regex macro expansion path; después, reproduce el problema con la solicitud curl proporcionada contra la regla 920420 de CRS. Compara el comportamiento de debug-log de 2.9.7 y 2.9.8; se considera completado cuando application/soap+xml se acepta como en 2.9.7 sin activar la regla.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
The way macros are expanded to regex patterns in rules changed from ModSecurity 2.9.7 to 2.9.8.
This affects CRS 3.2.x (920420, 920480) and CRS 3.3.x (920480) that both use the feature. CRS 4.x no longer uses this features and is thus not affected.
Logs and dumps
ModSecurity 2.9.7 debug log
... Resolved macro %{tx.allowed_request_content_type} to: application/x-www-form-urlencoded|multipart/form-data|text/xml|application/xml|application/soap+xml|application/x-amf|application/json|application/octet-stream|application/csp-report|application/xss-auditor-report|text/plain
... Escaping pattern [^application\/x-www-form-urlencoded|multipart\/form-data|text\/xml|application\/xml|application\/soap\+xml|application\/x-amf|application\/json|application\/octet-stream|application\/csp-report|application\/xss-auditor-report|text\/plain$]
...
... Rule returned 0.
... No match, not chained -> mode NEXT_RULE.
...
ModSecurity 2.9.8 debug log
... Resolved macro %{tx.allowed_request_content_type} to: application/x-www-form-urlencoded|multipart/form-data|text/xml|application/xml|application/soap+xml|application/x-amf|application/json|application/octet-stream|application/csp-report|application/xss-auditor-report|text/plain
... Expanded-macro pattern [^application\/x-www-form-urlencoded|multipart\/form-data|text\/xml|application\/xml|application\/soap\+xml|application\/x-amf|application\/json|application\/octet-stream|application\/csp-report|application\/xss-auditor-report|text\/plain$]
...
... Set variable "tx.anomaly_score_pl1" to "5".
...
To Reproduce
$ curl -H "Content-Type: application/soap+xml" -d "@example.xml" -v http://localhost
The content type application/soap+xml is in the list of allowed content-types for CRS 3.2.3 by default. With ModSecurity 2.9.8 it is suddenly no longer accepted and rule 920420 PL1 Request content type is not allowed by policy is being triggered by this Content-Type.
Expected behavior
Regex macro expansion behavior is the same between 2.9.7 and 2.9.8. The curl call above should not trigger CRS 920420 in version 3.2.3.
Server (please complete the following information):
- ModSecurity version (and connector): ModSecurity 2.9.8
- WebServer: Apache 2.4.63
- OS (and distro): Ubuntu
Rule Set (please complete the following information):
- CRS 3.2.x, CRS 3.3.x
Additional context
PR #2357 might be a candidate for the introduction of this bug.
- Lenguaje dominante
- C++
- Estrellas
- 9.8k
- Forks
- 1.8k
- Merge medio
- 2 h 46 min
- PR fusionados (30 d)
- 1
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de owasp-modsecurity/ModSecurity
-
2.x Platform - IIS
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
owasp-modsecurity/ModSecurity#3623 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
2.x Platform - IIS
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
owasp-modsecurity/ModSecurity#3621 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
2.x Platform - IIS
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
owasp-modsecurity/ModSecurity#3619 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
2.x Platform - IIS
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
owasp-modsecurity/ModSecurity#3612 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
3.x
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
owasp-modsecurity/ModSecurity#3580 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de owasp-modsecurity/ModSecurity
Issues similares
-
`enzymexla.linalg.lu` lowering fails for a tall matrix: the permutation is built with the pivot typeAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
EnzymeAD/Enzyme-JAX#3286 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
apache/iceberg-cpp#973 ·
Los mantenedores suelen responder en 1 día
-
Add c++23 mapping to nvccAbiertofeature request
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día