Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refuse requests with invalid and dangerous CR/LF/NUL in header field value, as demanded by rfc9110 section 5.5 #3253

Merged
merged 3 commits into from
Aug 6, 2024

Conversation

pajod
Copy link
Contributor

@pajod pajod commented Jul 30, 2024

Backwards incompatible behavior - but only in clear-cut cases of requests that are, and always have been, invalid and dangerous. Newer standards are more explicit in that they are not to be tolerated.

New parser rule: refuse HTTP requests where a header field value
contains characters that
a) should never appear there in the first place,
b) might have lead to incorrect treatment in a proxy in front, and
c) might lead to unintended behaviour in applications.

From RFC 9110 section 5.5:
"Field values containing CR, LF, or NUL characters are invalid and
dangerous, due to the varying ways that implementations might parse
and interpret those characters; a recipient of CR, LF, or NUL within
a field value MUST either reject the message or replace each of those
characters with SP before further processing or forwarding of that
message."
@benoitc benoitc merged commit 9a96e75 into benoitc:master Aug 6, 2024
23 checks passed
@benoitc
Copy link
Owner

benoitc commented Aug 6, 2024

this will need to be a 23 release though since it's introducing an incompatible behavior.

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.

fix header value to be compliant with new RFC 9110
2 participants