Relative Location response header is seen by the rules, nginx sends it absolute
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Perl
- Star
- 1.9k
- Fork
- 312
- Merge trung bình
- 2 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 4
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của owasp-modsecurity/ModSecurity-nginx
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
owasp-modsecurity/ModSecurity-nginx#418 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Possible dereference of NullĐang mở:1st_place_medal: good first issue enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
owasp-modsecurity/ModSecurity-nginx#359 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Transfer-Encoding and Connection response headers seen by the rules don't match the chunked filter'sCó thể đã có người làm @fzipi đã nhận hôm nay. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 22/100
owasp-modsecurity/ModSecurity-nginx#420 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Documentation: Clarify dynamic module ABI compatibility with distribution-patched NGINX packagesCó thể đã có người làm @airween đã nhận hôm nay. Đang mởenhancement
owasp-modsecurity/ModSecurity-nginx#419 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Connection response header is seen by the rules on HTTP/2 responsesCó thể đã có người làm @fzipi đã nhận hôm nay. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
owasp-modsecurity/ModSecurity-nginx#415 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của owasp-modsecurity/ModSecurity-nginx
Issue tương tự
-
fix(rodex): sent mail loses the last character of title and bodyCó thể đã có người làm @baphomello đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
inverse-inc/packetfence#9768 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
-
Package Update Update Bot
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
priv-kweihmann/meta-sca#13307 ·