CVE-2023-45286: Github.com/go resty/resty/v2 Github.com/go-resty/resty/v2 HTTP Request Body Disclosure Vulnerability
MODERATECVE-2023-45286 is a MODERATE (CVSS 5.9) github.com/go-resty/resty/v2 http request body disclosure vulnerability (CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')) affecting Github.com/go resty/resty/v2 libraries in the Go ecosystem. The issue involves github.com/go-resty/resty/v2 http request body disclosure. Remediation is available by upgrading affected packages to version 2.11.0.
CVE-2023-45286 at a Glance
Security Impact
CVSS: 5.9
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N).
How to Fix CVE-2023-45286
To remediate this vulnerability, upgrade all affected Github.com/go resty/resty/v2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/go-resty/resty/v2 to 2.11.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/go-resty/resty/v2
How to Check if You Are Affected
To determine whether your application is affected by CVE-2023-45286, inspect your project dependencies for Github.com/go resty/resty/v2:
inspect dependencies for github.com/go-resty/resty/v2
Analyze the terminal output to locate any version of Github.com/go resty/resty/v2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.11.0), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition'), where the product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently. In Github.com/go resty/resty/v2, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2023-45286 Affected Github.com/go resty/resty/v2 Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/go-resty/resty/v2
|
Go |
≥ 2.10.0
< 2.11.0
|
2.11.0
|
References
Frequently Asked Questions
What is CVE-2023-45286?
Which Github.com/go resty/resty/v2 versions are affected?
What version fixes CVE-2023-45286?
Is github.com/go-resty/resty/v2 affected?
What is the CVSS score of CVE-2023-45286?
What CWE is associated with CVE-2023-45286?
How can I check Go dependencies for CVE-2023-45286?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-xwh9-gc39-5298",
"modified" : "2024-05-20T21:58:12Z",
"published" : "2023-11-28T17:36:21Z",
"aliases" : [ "CVE-2023-45286" ],
"summary" : "github.com/go-resty/resty/v2 HTTP request body disclosure",
"details" : "A race condition in go-resty can result in HTTP request body disclosure across requests.\n\nThis 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.\n\nThe sync.Pool in question is defined at package level scope, so a completely unrelated server could receive the request body.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/go-resty/resty/v2"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.10.0"
}, {
"fixed" : "2.11.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-45286"
}, {
"type" : "WEB",
"url" : "https://github.com/go-resty/resty/issues/739"
}, {
"type" : "WEB",
"url" : "https://github.com/go-resty/resty/issues/743"
}, {
"type" : "WEB",
"url" : "https://github.com/go-resty/resty/pull/745"
}, {
"type" : "WEB",
"url" : "https://github.com/go-resty/resty/commit/577fed8730d79f583eb48dfc81674164e1fc471e"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/go-resty/resty"
}, {
"type" : "WEB",
"url" : "https://github.com/go-resty/resty/releases/tag/v2.11.0"
}, {
"type" : "WEB",
"url" : "https://pkg.go.dev/vuln/GO-2023-2328"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-200", "CWE-362" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2023-11-28T17:36:21Z",
"nvd_published_at" : "2023-11-28T17:15:08Z"
}
}