-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(headers): add limit to maximum headers that should be parsed #290
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
Conversation
src/header/mod.rs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels a bit low. How about 256?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's better to restrict the total size instead of the count?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed other parsers did indeed restrict the total size. I thought that would be complicated, but I just thought of a way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to restrict the total size because actually it's possible to consume a lot of memory just by one header, e.g. Cookie.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, that is already checked in read_header.
dd7b14b to
b652b19
Compare
|
Updated to count characters instead of headers. |
|
👍 Can we make it configurable somehow in the future? |
src/header/mod.rs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's better to rename it? How about MAX_HEADERS_LENGTH?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
|
Hm, I guess it could be configurable by passing it as an argument to |
b652b19 to
f18a8fb
Compare
fix(headers): add limit to maximum headers that should be parsed
Closes #256