-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[balsa] Fix header size limit error messages. #22447
Conversation
Change error messages for too large headers that match ConnectionImpl::checkMaxHeadersSize() behavior. When http-parser parses a piece of data, it immediately calls ParserCallbacks::onHeaderField() or ParserCallbacks::onHeaderValue() with the current fragment of header key or value, and ConnectionImpl::checkMaxHeadersSize() checks size limit each time. On the other hand, BalsaFrame buffers the header key and value and only calls BalsaVisitorInterface::OnHeader() when the given header completes. In order to prevent from memory attacks, the header size limit is passed to BalsaFrame through BalsaParser constructor, and BalsaFrame internally enforces the limit while parsing. Signed-off-by: Bence Béky <bnc@google.com>
Signed-off-by: Bence Béky <bnc@google.com>
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.
Small functional delta for large test enablement!
Signed-off-by: Bence Béky <bnc@google.com>
Signed-off-by: Bence Béky <bnc@google.com>
Signed-off-by: Bence Béky <bnc@google.com>
… flag. Signed-off-by: Bence Béky <bnc@google.com>
Signed-off-by: Bence Béky <bnc@google.com>
LGTM |
Thank you both for the reviews. |
Kevin: PTAL /assign @KBaichoo |
Signed-off-by: Bence Béky <bnc@google.com>
/retest |
Retrying Azure Pipelines: |
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.
lgtm; I think CI is a flake; restarted it
/retest |
Retrying Azure Pipelines: |
Signed-off-by: Bence Béky <bnc@google.com>
/retest |
Retrying Azure Pipelines: |
Change error messages for too large headers that match
ConnectionImpl::checkMaxHeadersSize() behavior.
When http-parser parses a piece of data, it immediately calls
ParserCallbacks::onHeaderField() or ParserCallbacks::onHeaderValue()
with the current fragment of header key or value, and
ConnectionImpl::checkMaxHeadersSize() checks size limit each time.
On the other hand, BalsaFrame buffers the header key and value and only
calls BalsaVisitorInterface::OnHeader() when the given header completes.
In order to prevent from memory attacks, the header size limit is passed
to BalsaFrame through BalsaParser constructor, and BalsaFrame internally
enforces the limit while parsing.
Tracking issue: #21245
Signed-off-by: Bence Béky bnc@google.com
Commit Message: [balsa] Fix header size limit error messages.
Additional Description: n/a
Risk Level: low, BalsaParser is behind default-false flag
Testing: //test/common/http/http1:codec_impl_test
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: n/a