Relative Location response header is seen by the rules, nginx sends it absolute
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 25/100
Línea de trabajo
Start at the connector's phase 3 response-header filter and the point where RESPONSE_HEADERS is populated; compare it with nginx's terminal HTTP/1, HTTP/2 and HTTP/3 header filters. Reproduce with the directory redirect and SecRule RESPONSE_HEADERS:Location, then build the same absolute Location before rules run, honoring absolute_redirect, server_name_in_redirect, port_in_redirect, SSL/HTTP3 scheme and proxy_redirect. Done when the rule matches the client-visible URL and tests cover relative redirects, proxies, error_page redirects and ports.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
The response headers handed to the rules in phase 3 contain a relative Location as it is, for example /dir/. With absolute_redirect on, the default, nginx sends an absolute URL instead: http://localhost:8080/dir/.
nginx builds the absolute value in its terminal header filters (HTTP/1, HTTP/2 and HTTP/3), which run after the connector's header filter. The host comes from server_name_in_redirect, the Host header or the local address. The port depends on port_in_redirect, and the scheme is https over SSL or HTTP/3. A rule on RESPONSE_HEADERS:Location written against what clients receive therefore never matches a redirect nginx built from a relative URI: directory redirects, proxy_redirect results, error_page ... =301 /path, etc.
To reproduce
With a directory dir under the root:
location / {
modsecurity on;
modsecurity_rules '
SecRuleEngine On
SecRule RESPONSE_HEADERS:Location "@streq http://localhost:8080/dir/" "id:1,phase:3,deny,status:403"
';
}
curl -i http://localhost:8080/dir returns 301 with Location: http://localhost:8080/dir/. The rule should have matched and returned 403.
- Lenguaje dominante
- Perl
- Estrellas
- 1.9k
- Forks
- 312
- Merge medio
- 2 d 22 h
- PR fusionados (30 d)
- 4
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-nginx
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
owasp-modsecurity/ModSecurity-nginx#418 ·
Los mantenedores suelen responder en 1 día
-
Possible dereference of NullAbierto:1st_place_medal: good first issue enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
owasp-modsecurity/ModSecurity-nginx#359 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Transfer-Encoding and Connection response headers seen by the rules don't match the chunked filter'sPosiblemente ocupada @fzipi la tomó hoy. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 22/100
owasp-modsecurity/ModSecurity-nginx#420 ·
Los mantenedores suelen responder en 1 día
-
Documentation: Clarify dynamic module ABI compatibility with distribution-patched NGINX packagesPosiblemente ocupada @airween la tomó hoy. Abiertoenhancement
owasp-modsecurity/ModSecurity-nginx#419 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Connection response header is seen by the rules on HTTP/2 responsesPosiblemente ocupada @fzipi la tomó hoy. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
owasp-modsecurity/ModSecurity-nginx#415 ·
Los mantenedores suelen responder en 1 día
Todos los issues de owasp-modsecurity/ModSecurity-nginx
Issues similares
-
fix(rodex): sent mail loses the last character of title and bodyPosiblemente ocupada @baphomello la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
inverse-inc/packetfence#9768 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
metacpan/metacpan-api#1534 ·