🛡️ CVE-2026-42033 — axios

🟠 CVSS 8.0 — High ⚠️ Exploit Public CWE-1321 OSV
8.0
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

Axios: Prototype Pollution Gadgets - Response Tampering, Data Exfiltration, and Request Hijacking

Summary

When Object.prototype has been polluted by any co-dependency with keys that axios reads without a hasOwnProperty guard, an attacker can (a) silently intercept and modify every JSON response before the application sees it, or (b) fully hijack the underlying HTTP transport, gaining access to request credentials, headers, and body. The precondition is prototype pollution from a separate source in the same process -- lodash < 4.17.21, or any of several other common npm packages with known PP vectors. The two gadgets confirmed here work independently.

Background: how mergeConfig builds the config object

Every axios request goes through Axios._request in [lib/core/Axios.js#L76](https://github.com/axios/axios/blob/v1.13.6/lib/core/Axios.js#L76):

```js

config = mergeConfig(this.defaults, config);

```

Inside mergeConfig, the merged config is built as a plain {} object ([lib/core/mergeConfig.js#L20](https://github.com/axios/axios/blob/v1.13.6/lib/core/mergeConfig.js#L20)):

```js

const config = {};

```

A plain {} inherits from Object.prototype. mergeConfig only iterates Object.keys({ ...config1, ...config2 }) ([line 99](https://github.com/axios/axios/blob/v1.13.6/lib/core/mergeConfig.js#L99)), which is a spread of own properties. Any key that is absent from both this.defaults and the per-request config will never be set as an own property on the merged config. Reading that key later on the merged config falls through to Object.prototype. That is the root mechanism behind all gadgets below.

Gadget 1: parseReviver -- response tampering and exfiltration

Introduced in: v1.12.0 (commit 2a97634, PR #5926)

Affected range: >= 1.12.0, <= 1.13.6

Root cause

The default transformResponse function calls [JSON.parse(data, this.parseReviver)](https://github.com/axios/axios/blob/v1.13.6/lib/defaults/index.js#L124):

```js

return JSON.parse(data, this.parseReviver);

```

this is the merged config. parseReviver is not present in defaults and is not in the mergeMap inside mergeConfig. It is never set as an own property on the merged config. Accessing this.parseReviver therefore walks the prototype chain.

The call fires by default on every string response body because [lib/defaults/transitional.js#L5](https://github.com/axios/axios/blob/v1.13.6/lib/defaults/transitional.js#L5) sets:

```js

forcedJSONParsing: true,

```

which activates the JSON parse path unconditionally when responseType is unset.

JSON.parse(text, reviver) calls the reviver for every key-value pair in the parsed result, bottom-up. The reviver's return value is what the caller receives. An attacker-controlled reviver can both observe every key-value pair and silently replace values.

There is no interaction with assertOptions here. The assertOptions call in Axios._request ([line 119](https://github.com/axios/axios/blob/v1.13.6/lib/core/Axios.js#L119)) iterates Object.keys(config), and since parseReviver was never set as an own property, it is not in that list. Nothing validates or invokes the polluted function before transformResponse does.

Verification: own-property check

```js

import { createRequire } from 'module';

const require = createRequire(import.meta.url);

const mergeConfig = require('./lib/core/mergeConfig.js').default;

const defaults = require('./lib/defaults/index.js').default;

const merged = mergeConfig(defaults, { url: '/test', method: 'get' });

console.log(Object.prototype.hasOwnProperty.call(merged, 'parseReviver')); // false

console.log(merged.parseReviver); // undefined (no pollution)

Object.prototype.parseReviver = function(k, v) { return v; };

console.log(merged.parseReviver); // [Function (anonymous)] -- inherited

delete Object.prototype.parseReviver;

```

Proof of concept

Two terminals. The server simulates a legitimate API endpoint. The client simulates a Node.js application whose process has been affected by prototype pollution from a co-dependency.

Terminal 1 -- server (server_gadget1.mjs):

```js

import http from 'http';

const server = http.createServer((req, res) => {

console.log('[server] request:', req.method, req.url);

res.writeHead(200, { 'Content-Type': 'application/json' });

res.end(JSON.stringify({ role: 'user', balance: 100, token: 'tok_real_abc' }));

});

server.listen(19003, '127.0.0.1', () => {

console.log('[server] listening on 127.0.0.1:19003');

});

```

```

$ node server_gadget1.mjs

[server] listening on 127.0.0.1:19003

[server] request: GET /

```

Terminal 2 -- client (poc_parsereviver.mjs):

```js

import axios from 'axios';

// Simulate pollution arriving from a co-dependency (e.g. lodash < 4.17.21 via _.merge).

// In a real application this would be set before any axios request runs.

Object.prototype.parseReviver = function (key, value) {

// Called for every key-value pair in every JSON response

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is high, an attacker needs no privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality high, integrity high, availability none.

Weakness class

CVE-2026-42033 is classified as CWE-1321: Prototype Pollution. Attacker input can modify an object prototype, changing behaviour for objects across the application.

Affected software

CVE-2026-42033 is recorded against 1 package.

  • axios

Timeline and source

Published on 5 May 2026 and last revised on 10 August 2026. A public exploit is known to exist, which raises the urgency of patching considerably. Record sourced from OSV.

References

github.com (Web)
nvd.nist.gov (Advisory)
github.com (Package)

CVE-2026-42033 on other distributions

Each distribution ships its own build and its own fixed version. Pick the one you run:

Details

Severity HIGH
CVSS Score 8.0
CVSS Vector CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N
CWE CWE-1321
Public Exploit ⚠️ Yes
Source OSV
Published 2026-05-05
Updated 2026-08-12
Modified 2026-08-10
Fix URL N/A

Affected Packages

Software From version Fixed in
axios

Exploit Protection

Are you running axios?

CVE-2026-42033 carries CVSS 8.0 High rating and a public exploit already exists. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.

Check My Site For CVE-2026-42033 →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.