Skip to content

Reject embedded NUL bytes before forwarding HTTP headers - #5

Merged
arin30 merged 2 commits into
mainfrom
fix/reject-header-nul-bytes
Oct 26, 2026
Merged

arin30 merged 2 commits into
mainfrom
fix/reject-header-nul-bytes

Conversation

@arin30

@arin30 arin30 commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Request-line and header fields must not be truncated at embedded NUL bytes. This rejects them in the parser and uses a byte-bounded terminator search in the socket reader so validation actually runs.

Coverage includes NUL bytes in the method, target, version, header name and value. The network regression asserts HTTP 400 for all five cases, no backend requests, and successful forwarding of a valid control request. The parser also accepts binary NUL bytes in a request body.

Validation: make check, make tls and git diff --check passed locally. The network test failed before the socket-reader fix and passed afterward. Local LeakSanitizer cannot run under this environment's process restrictions, so sanitizer validation is pending the existing Ubuntu CI job.

Signed-off-by: Arin Aeruva <43118055+arin30@users.noreply.github.com>
Use a byte-bounded header terminator search so embedded NUL bytes reach parser validation. Verify malformed requests never reach the backend, with a valid forwarding control.

Signed-off-by: Arin Aeruva <43118055+arin30@users.noreply.github.com>
@arin30
arin30 marked this pull request as ready for review October 26, 2026 18:51
@arin30
arin30 merged commit 7369426 into main Oct 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant