HTTP/2: Treat clients MAX_HEADER_LIST_SIZE as advisory#16883
Merged
Conversation
Motivation: SETTINGS_MAX_HEADER_LIST_SIZE is advisory per RFC 9113 §6.5.2. When acting as a server, the remote peer is a client whose advertised value reflects what it is prepared to receive. Honoring arbitrarily small values creates a DoS vector: a client setting this to 1 byte would prevent any valid response from being sent. Modification: When running as a server, the `DefaultHttp2ConnectionEncoder` now ignore the max header list size setting from clients. Result: Clients can no longer cheaply induce errors on an HTTP/2 server by advising unreasonably smaller header size limits. The behavior of ignoring the max header list size matches other H2 implementations, like nghttp2, nginx, and envoy.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation:
SETTINGS_MAX_HEADER_LIST_SIZE is advisory per RFC 9113 §6.5.2. When acting as a server, the remote peer is a client whose advertised value reflects what it is prepared to receive. Honoring arbitrarily small values creates a DoS vector: a client setting this to 1 byte would prevent any valid response from being sent.
Modification:
When running as a server, the
DefaultHttp2ConnectionEncodernow ignore the max header list size setting from clients.Result:
Clients can no longer cheaply induce errors on an HTTP/2 server by advising unreasonably smaller header size limits.
The behavior of ignoring the max header list size matches other H2 implementations, like nghttp2, nginx, and envoy.