Tests: added proxy CRLF injection tests - #55
Draft
louzt wants to merge 1 commit into
Draft
Conversation
This was referenced May 31, 2026
louzt
force-pushed
the
test/proxy-crlf-runtime
branch
from
August 7, 2026 22:30
9b988cc to
af113f3
Compare
Author
|
Rebased onto current master and updated the body to reflect the current proxy runtime boundary scope. The response-filter path is intentionally covered separately by nginx-tests#58 alongside nginx#1414. Lab notes: https://gist.github.com/louzt/7bdf370a28126718e7e7b69d53b0ae86 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a native
nginx-testsregression test for CRLF injection through runtime-expanded variables used while NGINX serializes HTTP/1.x proxy requests.The test covers:
proxy_pass .../$uri, asserting a CRLF-bearing URI is rejected and no injected field reaches the upstream socket;proxy_set_header X-Normalized-URI $uri, asserting CRLF, LF-only, and CR-only values are rejected;Why
This is the narrow runtime proxy boundary discussed in nginx/nginx#590. It intentionally does not change inbound parser policy, config-time validation, or response header/trailer behavior.
The response-filter cases (
add_header/add_trailer) are a separate state-machine and policy question, so they are not included in this first test PR. They are covered by nginx-tests#58 alongside the companion nginx#1414.Validation
Ran locally against a patched NGINX build containing the proxy runtime rejection and log-level slice:
Result:
Supplementary lab notes and branch matrix: https://gist.github.com/louzt/7bdf370a28126718e7e7b69d53b0ae86
Status
Draft until the matching NGINX core fix in nginx/nginx#1424 (the active H2/H3 reject thread that addresses the broader hardening direction) or its successor lands.
Follow-ups
The response-filter path is intentionally a separate policy PR. nginx-tests#58 covers the add_header / add_trailer companion to nginx#1414 and moves with that core fix.