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

net/http: ReadRequest can stack overflow [1.15 backport] #45711

Closed
gopherbot opened this issue Apr 22, 2021 · 6 comments
Closed

net/http: ReadRequest can stack overflow [1.15 backport] #45711

gopherbot opened this issue Apr 22, 2021 · 6 comments

Comments

@gopherbot
Copy link

@gopherbot gopherbot commented Apr 22, 2021

@katiehockman requested issue #45710 to be considered for backport to the next 1.15 minor release.

@gopherbot please consider this for backport to 1.16.4 and 1.15.12, it's a security issue.

@dmitshur
Copy link
Contributor

@dmitshur dmitshur commented Apr 28, 2021

Approved as this is a security fix. This backport applies to both 1.16 (#45712) and 1.15 (this issue).

@dmitshur dmitshur changed the title http: ReadRequest can stack overflow [1.15 backport] net/http: ReadRequest can stack overflow [1.15 backport] Apr 28, 2021
@gopherbot
Copy link
Author

@gopherbot gopherbot commented Apr 28, 2021

Change https://golang.org/cl/314650 mentions this issue: [release-branch.go1.15] http/httpguts: remove recursion in HeaderValuesContainsToken

@gopherbot
Copy link
Author

@gopherbot gopherbot commented Apr 28, 2021

Closed by merging 261fb518b1ed846d17ed4bf64d95e8a0a7894600 to release-branch.go1.15.

gopherbot pushed a commit to golang/net that referenced this issue Apr 28, 2021
…esContainsToken

Previously, httpguts.HeaderValuesContainsToken called a
function which could recurse to the point of a stack
overflow when given a very large header (~10MB).

Credit to Guido Vranken who reported the crash as
part of the Ethereum 2.0 bounty program.

Fixes CVE-2021-31525

Updates golang/go#45710
Updates golang/go#45711

Change-Id: I2c54ce3b2acf1c5efdea66db0595b93a3f5ae5f3
Reviewed-on: https://go-review.googlesource.com/c/net/+/313069
Trust: Katie Hockman <katie@golang.org>
Run-TryBot: Katie Hockman <katie@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
(cherry picked from commit 89ef3d9)
Reviewed-on: https://go-review.googlesource.com/c/net/+/314650
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
@gopherbot gopherbot closed this Apr 28, 2021
@dmitshur
Copy link
Contributor

@dmitshur dmitshur commented Apr 28, 2021

Reopening for update to the vendored copy in the Go tree (step 2 at https://golang.org/wiki/MinorReleases#cherry-pick-cls-for-vendored-golangorgx-packages).

@dmitshur dmitshur reopened this Apr 28, 2021
@gopherbot gopherbot closed this Apr 28, 2021
@dmitshur dmitshur reopened this Apr 28, 2021
@gopherbot
Copy link
Author

@gopherbot gopherbot commented Apr 28, 2021

Change https://golang.org/cl/314790 mentions this issue: [release-branch.go1.15] std: update golang.org/x/net to 20210428183841-261fb518b1ed

gopherbot pushed a commit that referenced this issue Apr 28, 2021
…1-261fb518b1ed

Steps:
  go get -d golang.org/x/net@release-branch.go1.15
  go mod tidy
  go mod vendor

This http2 bundle does not need to be updated.

Fixes #45711

Change-Id: I085ca592dfc8d5d9c328a7979142e88e7130a813
Reviewed-on: https://go-review.googlesource.com/c/go/+/314790
Trust: Katie Hockman <katie@golang.org>
Run-TryBot: Katie Hockman <katie@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
@dmitshur
Copy link
Contributor

@dmitshur dmitshur commented Apr 28, 2021

Fixred by merging 5aed4ce to release-branch.go1.15.

@dmitshur dmitshur closed this Apr 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants