-
Notifications
You must be signed in to change notification settings - Fork 62
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
x/vulndb: potential Go vuln in github.com/go-resty/resty/v2: CVE-2023-45286 #2328
Comments
Dang. https://github.com/search?q=resty+SetRetryCount+language%3AGo&type=code Just a little bit of vulnerable code. |
Change https://go.dev/cl/545206 mentions this issue: |
Hi, thank you for your report, and apologies for the delay. This vulnerability has been assigned ids GO-2023-2328 and CVE-2023-45286. The report in CL https://go.dev/cl/545206 will be published soon; please comment here or on that CL if you have any suggested edits. |
No worries, and thank you! |
Aliases: CVE-2023-45286 Updates #2328 Change-Id: I5c53cf4e061c940f30dd68ae3593ff3b39f168bf Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/545206 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Damien Neil <[email protected]>
Change https://go.dev/cl/547980 mentions this issue: |
Add missing GHSA. Aliases: CVE-2023-45286, GHSA-xwh9-gc39-5298 Updates #2328 Fixes #2357 Change-Id: Ie4b7593cc7bb3251d5919db76ddfe99a4fdeff15 Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/547980 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Damien Neil <[email protected]>
Change https://go.dev/cl/554135 mentions this issue: |
Change https://go.dev/cl/554155 mentions this issue: |
Add fixed version and fix commit. Aliases: CVE-2023-45286, GHSA-xwh9-gc39-5298 Updates #2328 Updates #2427 Change-Id: Ia8373db660975a01f455d2b60d5e1d9f73a2c30b Reviewed-on: https://go-review.googlesource.com/c/vulndb/+/554155 Reviewed-by: Tim King <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
Acknowledgement
Description
go-resty
v2.10.0 introduced a race condition that results in HTTP request body disclosure across requests, by callingsync.Pool.Put
with the same*bytes.Buffer
more than once, when request retries are enabled and a retry occurs.When this condition is triggered, the call to
sync.Pool.Get
will return abytes.Buffer
that hasn't hadbytes.Buffer.Reset
called on it. This dirty buffer will contain the HTTP request body from an unrelated request, andgo-resty
will append the current HTTP request body to it, sending two bodies in one request.The
sync.Pool
in question is defined at package level scope, so a completely unrelated server could receive the request body.Affected Modules, Packages, Versions and Symbols
CVE/GHSA ID
No response
Fix Commit or Pull Request
go-resty/resty#745
References
Additional information
It would be awesome if
sync.Pool
kept track of returned memory addresses when go's race detector is enabled, it would have made tracking this down a lot faster.The text was updated successfully, but these errors were encountered: