[internal-branch.go1.20-vendor] http2/hpack: avoid quadratic complexi… #14
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.
…ty in hpack decoding
When parsing a field literal containing two Huffman-encoded strings, don't decode the first string until verifying all data is present. Avoids forced quadratic complexity when repeatedly parsing a partial field, repeating the Huffman decoding of the string on each iteration.
Thanks to Philippe Antoine (Catena cyber) for reporting this issue.
Fixes golang/go#57855
Fixes CVE-2022-41723
For golang/go#58356
Change-Id: I58a743df450a4a4923dddd5cf6bb0592b0a7bdf3 Reviewed-on: https://team-review.git.corp.google.com/c/golang/go-private/+/1688184
TryBot-Result: Security TryBots [email protected]
Reviewed-by: Julie Qiu [email protected]
Run-TryBot: Damien Neil [email protected]
Reviewed-by: Roland Shoemaker [email protected]
Reviewed-on: https://go-review.googlesource.com/c/net/+/468135
Run-TryBot: Michael Pratt [email protected]
Reviewed-by: Roland Shoemaker [email protected]
Reviewed-by: Than McIntosh [email protected]
Auto-Submit: Michael Pratt [email protected]
TryBot-Result: Gopher Robot [email protected]
(cherry picked from commit 8e2b117) Reviewed-on: https://go-review.googlesource.com/c/net/+/468336