CVE-2024-39338: Axios Server-Side Request Forgery Vulnerability
HIGHCVE-2024-39338 is a HIGH server-side request forgery vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Axios libraries in the npm ecosystem. The issue involves server-side request forgery in axios. Remediation is available by upgrading affected packages to version 1.7.4.
CVE-2024-39338 at a Glance
How to Fix CVE-2024-39338
To remediate this vulnerability, upgrade all affected Axios dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install axios@1.7.4
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls axios
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2024-39338, inspect your project dependencies using npm:
npm ls axios
Analyze the terminal output to locate any version of Axios in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.7.4), your application is affected.
Note: The npm ls axios command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. In Axios, 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-39338 Affected Axios Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
axios
|
npm |
≥ 1.3.2
< 1.7.4
|
1.7.4
|
References
Frequently Asked Questions
What is CVE-2024-39338?
Which Axios versions are affected?
What version fixes CVE-2024-39338?
Is axios affected?
What CWE is associated with CVE-2024-39338?
How can I check npm dependencies for CVE-2024-39338?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-8hc4-vh64-cxmj",
"modified" : "2024-08-13T19:53:23Z",
"published" : "2024-08-12T15:30:49Z",
"aliases" : [ "CVE-2024-39338" ],
"summary" : "Server-Side Request Forgery in axios",
"details" : "axios 1.7.2 allows SSRF via unexpected behavior where requests for path relative URLs get processed as protocol relative URLs.",
"severity" : [ ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "axios"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.3.2"
}, {
"fixed" : "1.7.4"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 1.7.3"
}
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-39338"
}, {
"type" : "WEB",
"url" : "https://github.com/axios/axios/issues/6463"
}, {
"type" : "WEB",
"url" : "https://github.com/axios/axios/pull/6539"
}, {
"type" : "WEB",
"url" : "https://github.com/axios/axios/pull/6543"
}, {
"type" : "WEB",
"url" : "https://github.com/axios/axios/commit/6b6b605eaf73852fb2dae033f1e786155959de3a"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/axios/axios"
}, {
"type" : "WEB",
"url" : "https://github.com/axios/axios/releases"
}, {
"type" : "WEB",
"url" : "https://github.com/axios/axios/releases/tag/v1.7.4"
}, {
"type" : "WEB",
"url" : "https://jeffhacks.com/advisories/2024/06/24/CVE-2024-39338.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-918" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2024-08-12T17:26:43Z",
"nvd_published_at" : "2024-08-12T13:38:24Z"
}
}