Skip to content

fix: lenient chunk extension parsing leading to request smuggling issues - #1899

Merged
erikdubbelboer merged 3 commits into
valyala:masterfrom
JeppW:master
Nov 24, 2024
Merged

erikdubbelboer merged 3 commits into
valyala:masterfrom
JeppW:master

Conversation

@JeppW

@JeppW JeppW commented Nov 12, 2024 •

Copy link
Copy Markdown
Contributor

fasthttp allows newlines (\n) between the chunk size and the CRLF (i.e. in the chunk extension). This can cause request smuggling issues with some reverse proxies. This PR prevents this potential vulnerability by disallowing newlines in the chunk extension.

I've also corrected two unescaped carriage returns in error messages which messed with the output formatting.

@erikdubbelboer

Copy link
Copy Markdown
Collaborator

Can you fix the lint issue?

http.go:2518:13: fmt.Errorf can be replaced with errors.New (perfsprint)
  					error: fmt.Errorf("invalid character '\\n' after chunk size")

@JeppW

JeppW commented Nov 15, 2024

Copy link
Copy Markdown
Contributor Author

Should be okay now, can you rerun the workflows?

@erikdubbelboer
erikdubbelboer merged commit 7b74fc9 into valyala:master Nov 24, 2024
@erikdubbelboer

Copy link
Copy Markdown
Collaborator

Thanks!

@JLLeitschuh

Copy link
Copy Markdown

This looks like it fixed a legitimate security vulnerability. Shouldn't a CVE be assigned? Would the fasthttp be willing to facilitate this? @erikdubbelboer

Would you be willing to open a GitHub security advisory here? https://github.com/valyala/fasthttp/security

Issue tracking for CVE assignment: JLLeitschuh/unCVEed#1

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.

3 participants