Skip to content

fix: strip CRLF from response header values - #14

Open
I3eg1nner wants to merge 1 commit into
oboard:mainfrom
I3eg1nner:fix/cwe113-crlf-header-injection
Open

fix: strip CRLF from response header values#14
I3eg1nner wants to merge 1 commit into
oboard:mainfrom
I3eg1nner:fix/cwe113-crlf-header-injection

Conversation

@I3eg1nner

@I3eg1nner I3eg1nner commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

User-controlled values written to response headers are not sanitized.
A POST body reflected into a Set-Cookie or custom header can inject
\r\n sequences, allowing HTTP response splitting.

Add sanitize_header_value() that strips CR/LF, and apply it in all
three backends (native, mongoose, JS) before writing headers and
cookies to the response.

Note: PRs #14, #15, #16 have been reviewed by GPT-5.6 sol to ensure code quality.

🤖 Generated with Claude Code

Response headers pass user-controlled values to the HTTP layer without
sanitizing \r\n. An attacker who controls a header value (e.g. via a
redirect target or reflected parameter) can inject arbitrary headers
(Set-Cookie, Cache-Control) or split the response.

Add sanitize_header_value() and apply it at all three response paths:
native, mongoose, and JS.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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