CVE-2026-101904: Axios Remote Code Execution Vulnerability
MODERATECVE-2026-101904 is a MODERATE remote code execution vulnerability (CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')) affecting Axios libraries in the npm ecosystem. The issue involves header injection via inherited headers after minimal interceptor. Remediation is available by upgrading affected packages to version 1.20.0.
CVE-2026-101904 at a Glance
How to Fix CVE-2026-101904
To remediate this vulnerability, upgrade all affected Axios dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install axios@1.20.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls axios
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2026-101904, inspect your project dependencies using npm:
npm ls axios
Analyze the terminal output to locate any version of Axios in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.20.0), your application is affected.
Note: The npm ls axios command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution'), where the product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype. In Axios, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-101904 Affected Axios Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
axios
|
npm |
≥ 1.0.0
< 1.20.0
|
1.20.0
|
References
Frequently Asked Questions
What is CVE-2026-101904?
Which Axios versions are affected?
What version fixes CVE-2026-101904?
Is axios affected?
What CWE is associated with CVE-2026-101904?
How can I check npm dependencies for CVE-2026-101904?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-j8rh-479h-cp32",
"modified" : "2026-09-30T15:35:14Z",
"published" : "2026-09-30T15:35:14Z",
"aliases" : [ "CVE-2026-101904" ],
"summary" : "Axios: Header Injection via Inherited headers After Minimal Interceptor",
"details" : "## Summary\n\nAxios 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.\n\nAxios 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.\n\n## Impact\n\nAn 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.\n\nThe issue is conditional and should not be described as affecting every interceptor or every request.\n\n## Affected Functionality\n\nAffected:\n\n- Request interceptor chains where an interceptor returns a new ordinary object.\n- Replacement config objects that omit an own `headers` property.\n- `dispatchRequest()` header normalization through `AxiosHeaders.from(config.headers)`.\n\nNot affected:\n\n- Requests whose interceptor preserves an own `headers` property.\n- Interceptors that mutate and return the existing null-prototype config.\n- Processes without prototype pollution.\n\n## Technical Details\n\n`lib/core/dispatchRequest.js` contains:\n\n```js\nconfig.headers = AxiosHeaders.from(config.headers);\n```\n\nThe 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`.\n\nLocal 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`.\n\n## Proof of Concept of Attack\n\nConstrained local demonstration:\n\n```js\nObject.prototype.headers = { 'X-Poisoned': 'yes' };\n\nconst client = axios.create();\nclient.interceptors.request.use((config) => ({\n url: config.url,\n method: config.method,\n timeout: config.timeout\n}));\n\nawait client.get(url);\n```\n\nExpected safe behavior is that missing headers normalize to an empty header set. Current affected behavior reads inherited `Object.prototype.headers`.\n\n## Workarounds\n\nInterceptors 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.\n\n<details>\n <summary><h3>Original report</h3></summary>\n \n\n## Summary\n\nAxios 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`.\n\nThis allows attacker-controlled headers to be placed on the wire.\n\n## Affected Version\n\nValidated on:\n\n- axios: `1.17.0`\n- commit: `4306df2`\n- runtime: Node.js `v24.15.0`\n\n## Preconditions\n\n- A separate prototype-pollution primitive can write an object to `Object.prototype.headers`.\n- A request interceptor rebuilds config and omits own `headers`.\n\n## Root Cause\n\n`dispatchRequest()` uses:\n\n```js\nconfig.headers = AxiosHeaders.from(config.headers);\n```\n\nIf `config` is a normal object returned by an interceptor and lacks own `headers`, this reads `Object.prototype.headers`.\n\n## Impact\n\nAn 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.\n\n## Proof of Concept\n\n```js\nimport axios from './index.js';\nimport http from 'http';\n\nconst start = (handler) => new Promise((resolve) => {\n const server = http.createServer(handler);\n server.listen(0, '127.0.0.1', () => resolve(server));\n});\n\nconst stop = (server) => new Promise((resolve) => server.close(resolve));\n\nconst hits = [];\n\nconst server = await start((req, res) => {\n hits.push(req.headers);\n res.setHeader('Content-Type', 'application/json');\n res.end('{\"ok\":true}');\n});\n\ntry {\n Object.prototype.headers = {\n 'X-Poisoned': 'yes',\n 'If-None-Match': '*'\n };\n\n const client = axios.create();\n client.interceptors.request.use((config) => ({\n url: config.url,\n method: config.method,\n timeout: config.timeout\n }));\n\n await client.get(`http://127.0.0.1:${server.address().port}/headers`, {\n timeout: 3000\n });\n\n console.log(hits[0]);\n} finally {\n delete Object.prototype.headers;\n await stop(server);\n}\n```\n\nObserved wire headers:\n\n```json\n{\n \"x-poisoned\": \"yes\",\n \"if-none-match\": \"*\",\n \"user-agent\": \"axios/1.17.0\"\n}\n```\n\n## References\n\n- https://github.com/axios/axios/security/advisories/GHSA-898c-q2cr-xwhg\n- https://osv.dev/vulnerability/GHSA-898c-q2cr-xwhg\n</details>\n---",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "axios"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.0.0"
}, {
"fixed" : "1.20.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/axios/axios/security/advisories/GHSA-j8rh-479h-cp32"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-101904"
}, {
"type" : "WEB",
"url" : "https://github.com/axios/axios/pull/11141"
}, {
"type" : "WEB",
"url" : "https://github.com/axios/axios/commit/d19040bda7a8be2f82c3c6e1a5bc03917daee39a"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/axios/axios"
}, {
"type" : "WEB",
"url" : "https://github.com/axios/axios/releases/tag/v1.20.0"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1321", "CWE-74" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-09-30T15:35:14Z",
"nvd_published_at" : "2026-09-28T18:17:18Z"
}
}