Vulnerabilities in pkg:golang/github.com/imroc/req/v3
PACKAGECVE-2024-45258 is a MODERATE (CVSS 7.2) req may send an unintended vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Github.com/imroc/req/v3 libraries in the Go ecosystem. The issue involves req may send an unintended request when a malformed url is provided. Remediation is available by upgrading affected packages to version 3.43.4.
pkg:golang/github.com/imroc/req/v3
Vulnerability advisories affecting package pkg:golang/github.com/imroc/req/v3. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-cj55-gc7m-wvcq | CVE-2024-45258 | MODERATE | req may send an unintended request when a malformed URL is provided |
CVE-2024-45258 at a Glance
Security Impact
CVSS: 7.2
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N).
How to Fix CVE-2024-45258
To remediate this vulnerability, upgrade all affected Github.com/imroc/req/v3 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/imroc/req/v3 to 3.43.4
Upgrade github.com/imroc/req to 3.43.4
Upgrade github.com/imroc/req/v2 to 3.43.4
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/imroc/req/v3
How to Check if You Are Affected
To determine whether your application is affected by CVE-2024-45258, inspect your project dependencies for Github.com/imroc/req/v3:
inspect dependencies for github.com/imroc/req/v3
Analyze the terminal output to locate any version of Github.com/imroc/req/v3 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.43.4), 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-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Github.com/imroc/req/v3, 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-2024-45258 Affected Github.com/imroc/req/v3 Versions
3 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/imroc/req/v3
|
Go |
< 3.43.4
|
3.43.4
|
|
github.com/imroc/req
|
Go |
< 3.43.4
|
3.43.4
|
|
github.com/imroc/req/v2
|
Go |
< 3.43.4
|
3.43.4
|
References
Frequently Asked Questions
What is CVE-2024-45258?
Which Github.com/imroc/req/v3 versions are affected?
What version fixes CVE-2024-45258?
Is github.com/imroc/req/v3 affected?
Is github.com/imroc/req affected?
What is the CVSS score of CVE-2024-45258?
What CWE is associated with CVE-2024-45258?
How can I check Go dependencies for CVE-2024-45258?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-cj55-gc7m-wvcq",
"modified" : "2024-11-18T16:27:07Z",
"published" : "2024-08-26T00:30:54Z",
"aliases" : [ "CVE-2024-45258" ],
"summary" : "req may send an unintended request when a malformed URL is provided",
"details" : "The `req` library is a widely used HTTP library in Go. However, it does not handle malformed URLs effectively. As a result, after parsing a malformed URL, the library may send HTTP requests to unexpected destinations, potentially leading to security vulnerabilities or unintended behavior in applications relying on this library for handling HTTP requests.\n\nDespite developers potentially utilizing the `net/url` library to parse malformed URLs and implement blocklists to prevent HTTP requests to listed URLs, inconsistencies exist between how the `net/url` and `req` libraries parse URLs. These discrepancies can lead to the failure of defensive strategies, resulting in potential security threats such as Server-Side Request Forgery (SSRF) and Remote Code Execution (RCE).",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/imroc/req/v3"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.43.4"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/imroc/req"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.43.4"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/imroc/req/v2"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.43.4"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-45258"
}, {
"type" : "WEB",
"url" : "https://github.com/imroc/req/commit/04e3ece5b380ecad9da3551c449f1b8a9aa76d3d"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/imroc/req"
}, {
"type" : "WEB",
"url" : "https://github.com/imroc/req/compare/v3.43.3...v3.43.4"
}, {
"type" : "WEB",
"url" : "https://pkg.go.dev/vuln/GO-2024-3098"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-20", "CWE-918", "CWE-94" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-08-26T15:54:18Z",
"nvd_published_at" : "2024-08-25T22:15:05Z"
}
}