CVE-2026-40175: Axios Axios Has Unrestricted Cloud Metadata Vulnerability
MODERATECVE-2026-40175 is a MODERATE (CVSS 4.8) axios has unrestricted cloud metadata vulnerability (CWE-113: Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Request/Response Splitting')) affecting Axios libraries in the npm ecosystem. The issue involves axios has unrestricted cloud metadata exfiltration via header injection chain. Remediation is available by upgrading affected packages to version 1.15.0, 0.31.0.
CVE-2026-40175 at a Glance
Security Impact
CVSS: 4.8
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:L/I:L/A:N).
How to Fix CVE-2026-40175
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.15.0
npm install axios@0.31.0
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-2026-40175, 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.15.0), 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-113: Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Request/Response Splitting'), where the product receives data from an http agent/component (e.g., web server, proxy, browser, etc.), but it does not neutralize or incorrectly neutralizes cr and lf characters before the data is included in outgoing http headers. 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-2026-40175 Affected Axios Versions
2 component(s)References
Frequently Asked Questions
What is CVE-2026-40175?
Which Axios versions are affected?
What version fixes CVE-2026-40175?
Is axios affected?
What is the CVSS score of CVE-2026-40175?
What CWE is associated with CVE-2026-40175?
How can I check npm dependencies for CVE-2026-40175?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-fvcv-3m26-pcqx",
"modified" : "2026-05-20T00:25:27Z",
"published" : "2026-04-10T19:47:16Z",
"aliases" : [ "CVE-2026-40175" ],
"summary" : "Axios has Unrestricted Cloud Metadata Exfiltration via Header Injection Chain",
"details" : "# Vulnerability Disclosure: Unrestricted Cloud Metadata Exfiltration via Header Injection Chain\n\n## Summary\nThe Axios library is vulnerable to a specific gadget-style attack chain in which **prototype pollution** in a third-party dependency may be leveraged to inject unsanitized header values into outbound requests.\n\nAxios can be used as a gadget after pollution occurs elsewhere because header values merged from attacker-controlled prototype properties are not sanitized for CRLF (`\\r\\n`) characters before being written to the request. In affected deployments, this may enable limited request manipulation or metadata access as part of a higher-complexity exploit chain.\n\n**Severity**: Moderate (CVSS 3.1 Base Score: 4.8)\n**Affected Versions**: All versions (v0.x - v1.x)\n**Vulnerable Component**: `lib/adapters/http.js` (Header Processing)\n\n## Usage of \\\"Helper\\\" Vulnerabilities\nThis issue requires a separate **prototype pollution** vulnerability in another library in the application stack (for example, `qs`, `minimist`, `ini`, or `body-parser`). If an attacker can pollute `Object.prototype`, Axios may pick up the polluted properties during config merge.\n\nBecause Axios does not sanitise these merged header values for CRLF (`\\r\\n`) characters, the polluted property can alter the structure of an outbound HTTP request.\n\n## Proof of Concept\n\n### 1. The Setup (Simulated Pollution)\nImagine a scenario where a known vulnerability exists in a query parser. The attacker sends a payload that sets:\n```javascript\nObject.prototype['x-amz-target'] = \\\"dummy\\r\\n\\r\\nPUT /latest/api/token HTTP/1.1\\r\\nHost: 169.254.169.254\\r\\nX-aws-ec2-metadata-token-ttl-seconds: 21600\\r\\n\\r\\nGET /ignore\\\";\n```\n\n### 2. The Gadget Trigger (Safe Code)\nThe application makes a completely safe, hardcoded request:\n```javascript\n// This looks safe to the developer\nawait axios.get('https://analytics.internal/pings'); \n```\n\n### 3. The Execution\nAxios merges the prototype property `x-amz-target` into the request headers. It then writes the header value directly to the socket without validation.\n\n**Resulting HTTP traffic:**\n```http\nGET /pings HTTP/1.1\nHost: analytics.internal\nx-amz-target: dummy\n\nPUT /latest/api/token HTTP/1.1\nHost: 169.254.169.254\nX-aws-ec2-metadata-token-ttl-seconds: 21600\n\nGET /ignore HTTP/1.1\n...\n```\n\n### 4. The Impact\nIn environments where requests can reach cloud metadata endpoints or sensitive internal services, the injected header content may help bypass expected request constraints and expose limited credentials or modify request semantics. This impact depends on application context and a separate prototype-pollution primitive.\n\n## Impact Analysis\n- **Confidentiality**: May expose limited sensitive information in affected network environments.\n- **Integrity**: May allow modification of outbound request structure or injected headers.\n- **Attack Complexity**: Exploitation requires a separate prototype-pollution vulnerability and a reachable target service.\n\n## Recommended Fix\nValidate all header values in `lib/adapters/http.js` and `xhr.js` before passing them to the underlying request function.\n\n**Patch Suggestion:**\n```javascript\n// In lib/adapters/http.js\nutils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (/[\\r\\n]/.test(val)) {\n throw new Error('Security: Header value contains invalid characters');\n }\n // ... proceed to set header\n});\n```\n\n## References\n- **OWASP**: CRLF Injection (CWE-113)\n\nThis report was generated as part of a security audit of the Axios library.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "axios"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.0.0"
}, {
"fixed" : "1.15.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "npm",
"name" : "axios"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.31.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/axios/axios/security/advisories/GHSA-fvcv-3m26-pcqx"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-40175"
}, {
"type" : "WEB",
"url" : "https://github.com/axios/axios/pull/10660"
}, {
"type" : "WEB",
"url" : "https://github.com/axios/axios/pull/10660#issuecomment-4224168081"
}, {
"type" : "WEB",
"url" : "https://github.com/axios/axios/pull/10688"
}, {
"type" : "WEB",
"url" : "https://github.com/axios/axios/commit/03cdfc99e8db32a390e12128208b6778492cee9c"
}, {
"type" : "WEB",
"url" : "https://github.com/axios/axios/commit/363185461b90b1b78845dc8a99a1f103d9b122a1"
}, {
"type" : "WEB",
"url" : "https://cert-portal.siemens.com/productcert/html/ssa-876049.html"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/axios/axios"
}, {
"type" : "WEB",
"url" : "https://github.com/axios/axios/releases/tag/v0.31.0"
}, {
"type" : "WEB",
"url" : "https://github.com/axios/axios/releases/tag/v1.15.0"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-113", "CWE-444", "CWE-918" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-04-10T19:47:16Z",
"nvd_published_at" : "2026-04-10T20:16:22Z"
}
}