Skip to content

lib: fix response header component sanitization#2478

Open
quart27219 wants to merge 1 commit intodrogonframework:masterfrom
quart27219:master
Open

lib: fix response header component sanitization#2478
quart27219 wants to merge 1 commit intodrogonframework:masterfrom
quart27219:master

Conversation

@quart27219
Copy link
Copy Markdown

Fixes #2469.

It fixes response header component sanitization by stripping \r, \n, and \0 in HttpResponseImpl::addHeader().

This prevents response header injection / splitting when untrusted input is used in response headers.

@an-tao
Copy link
Copy Markdown
Member

an-tao commented Mar 31, 2026

@quart27219 Thanks so much for your patch, but this PR adds a mandatory check in the hotspot path, which actually increases the program overhead. I think this should be something that application developers need to pay attention to. They should know which addHeader calls are risky and should add such checks. @marty1885 @rbugajewski

@rbugajewski
Copy link
Copy Markdown
Collaborator

@an-tao Yes, I agree. In this case, it would be worthwhile to mention the risks in the corresponding documentation.

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.

[BUG] HTTP response header injection via unvalidated response header values in HttpResponse::addHeader

3 participants