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

sanitize headers #4

Open
gquintard opened this issue Dec 23, 2021 · 3 comments
Open

sanitize headers #4

gquintard opened this issue Dec 23, 2021 · 3 comments

Comments

@gquintard
Copy link
Owner

vcl::http::HTTP assumes headers are valid utf8 and joyfully unwraps conversions, we should make sure this never blows up

@nyurik
Copy link
Collaborator

nyurik commented Oct 30, 2024

are there any examples of the incorrect values?

@gquintard
Copy link
Owner Author

https://datatracker.ietf.org/doc/html/rfc7230#section-3.2
https://datatracker.ietf.org/doc/html/rfc7230#appendix-B
https://datatracker.ietf.org/doc/html/rfc5234#appendix-B.1

TL;DR:

   DIGIT          =  %x30-39
                                ; 0-9
   ALPHA          =  %x41-5A / %x61-7A   ; A-Z / a-z
   tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "." /
    "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA
   token = 1*tchar

@gquintard
Copy link
Owner Author

to answer your question, ^ is bad

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

No branches or pull requests

2 participants