NodeJS/axios/1.13.4
Promise based HTTP client for the browser and node.js
https://www.npmjs.com/package/axios
MIT
1 Security Vulnerabilities
Axios is Vulnerable to Denial of Service via __proto__ Key in mergeConfig
- https://github.com/axios/axios/security/advisories/GHSA-43fc-jf86-j433
- https://github.com/axios/axios/pull/7369
- https://github.com/axios/axios/commit/28c721588c7a77e7503d0a434e016f852c597b57
- https://github.com/axios/axios/releases/tag/v1.13.5
- https://nvd.nist.gov/vuln/detail/CVE-2026-25639
- https://github.com/advisories/GHSA-43fc-jf86-j433
- https://github.com/axios/axios/pull/7388
- https://github.com/axios/axios/commit/d7ff1409c68168d3057fc3891f911b2b92616f9e
- https://github.com/axios/axios/releases/tag/v0.30.3
Denial of Service via proto Key in mergeConfig
Summary
The mergeConfig function in axios crashes with a TypeError when processing configuration objects containing __proto__ as an own property. An attacker can trigger this by providing a malicious configuration object created via JSON.parse(), causing complete denial of service.
Details
The vulnerability exists in lib/core/mergeConfig.js at lines 98-101:
utils.forEach(Object.keys({ ...config1, ...config2 }), function computeConfigValue(prop) {
const merge = mergeMap[prop] || mergeDeepProperties;
const configValue = merge(config1[prop], config2[prop], prop);
(utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);
});
When prop is '__proto__':
JSON.parse('{"__proto__": {...}}')creates an object with__proto__as an own enumerable propertyObject.keys()includes'__proto__'in the iterationmergeMap['__proto__']performs prototype chain lookup, returningObject.prototype(truthy object)- The expression
mergeMap[prop] || mergeDeepPropertiesevaluates toObject.prototype Object.prototype(...)throwsTypeError: merge is not a function
The mergeConfig function is called by:
Axios._request()atlib/core/Axios.js:75Axios.getUri()atlib/core/Axios.js:201- All HTTP method shortcuts (
get,post, etc.) atlib/core/Axios.js:211,224
PoC
import axios from "axios";
const maliciousConfig = JSON.parse('{"__proto__": {"x": 1}}');
await axios.get("https://httpbin.org/get", maliciousConfig);
Reproduction steps:
- Clone axios repository or
npm install axios - Create file
poc.mjswith the code above - Run:
node poc.mjs - Observe the TypeError crash
Verified output (axios 1.13.4):
TypeError: merge is not a function
at computeConfigValue (lib/core/mergeConfig.js:100:25)
at Object.forEach (lib/utils.js:280:10)
at mergeConfig (lib/core/mergeConfig.js:98:9)
Control tests performed: | Test | Config | Result | |------|--------|--------| | Normal config | {"timeout": 5000} | SUCCESS | | Malicious config | JSON.parse('{"__proto__": {"x": 1}}') | CRASH | | Nested object | {"headers": {"X-Test": "value"}} | SUCCESS |
Attack scenario: An application that accepts user input, parses it with JSON.parse(), and passes it to axios configuration will crash when receiving the payload {"__proto__": {"x": 1}}.
Impact
Denial of Service - Any application using axios that processes user-controlled JSON and passes it to axios configuration methods is vulnerable. The application will crash when processing the malicious payload.
Affected environments:
- Node.js servers using axios for HTTP requests
- Any backend that passes parsed JSON to axios configuration
This is NOT prototype pollution - the application crashes before any assignment occurs.
129 Other Versions
| Version | License | Security | Released | |
|---|---|---|---|---|
| 0.15.1 | MIT | 6 | 2016-10-15 - 06:39 | over 9 years |
| 0.15.0 | MIT | 6 | 2016-10-11 - 04:40 | over 9 years |
| 0.14.0 | MIT | 6 | 2016-08-27 - 18:30 | over 9 years |
| 0.13.1 | MIT | 6 | 2016-07-16 - 17:13 | over 9 years |
| 0.13.0 | MIT | 6 | 2016-07-13 - 19:42 | over 9 years |
| 0.12.0 | MIT | 6 | 2016-06-01 - 05:22 | almost 10 years |
| 0.11.1 | MIT | 6 | 2016-05-17 - 15:59 | almost 10 years |
| 0.11.0 | MIT | 6 | 2016-04-27 - 04:19 | almost 10 years |
| 0.10.0 | MIT | 6 | 2016-04-21 - 04:52 | almost 10 years |
| 0.9.1 | MIT | 6 | 2016-01-24 - 22:19 | about 10 years |
| 0.9.0 | MIT | 6 | 2016-01-18 - 18:19 | about 10 years |
| 0.8.1 | MIT | 6 | 2015-12-15 - 03:44 | over 10 years |
| 0.8.0 | MIT | 5 | 2015-12-11 - 19:09 | over 10 years |
| 0.7.0 | MIT | 5 | 2015-09-29 - 06:36 | over 10 years |
| 0.6.0 | MIT | 5 | 2015-09-21 - 20:20 | over 10 years |
| 0.5.4 | MIT | 5 | 2015-04-08 - 18:49 | almost 11 years |
| 0.5.3 | MIT | 5 | 2015-04-08 - 03:01 | almost 11 years |
| 0.5.2 | MIT | 5 | 2015-03-13 - 23:14 | about 11 years |
| 0.5.1 | MIT | 5 | 2015-03-10 - 20:47 | about 11 years |
| 0.5.0 | MIT | 5 | 2015-01-23 - 10:15 | about 11 years |
| 0.4.2 | MIT | 5 | 2014-12-11 - 07:14 | over 11 years |
| 0.4.1 | MIT | 5 | 2014-10-15 - 18:19 | over 11 years |
| 0.4.0 | MIT | 5 | 2014-10-05 - 23:55 | over 11 years |
| 0.3.1 | MIT | 5 | 2014-09-17 - 00:31 | over 11 years |
| 0.3.0 | MIT | 5 | 2014-09-16 - 18:20 | over 11 years |
| 0.2.2 | MIT | 5 | 2014-09-15 - 03:30 | over 11 years |
| 0.2.1 | MIT | 5 | 2014-09-12 - 22:57 | over 11 years |
| 0.2.0 | MIT | 5 | 2014-09-12 - 20:06 | over 11 years |
| 0.1.0 | MIT | 5 | 2014-08-29 - 23:08 | over 11 years |
