CVE-2026-101904: Axios Remote Code Execution Vulnerability

MODERATE
Advisory Identifier: GHSA-j8rh-479h-cp32
CWE-1321 CWE-74
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2026-101904
GHSA Identifier GHSA-j8rh-479h-cp32
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
Affected Product Axios
Package Ecosystem npm
Published Date
Last Updated

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.

axios fixed: 1.20.0
npm install axios@1.20.0
Verify Direct and Transitive Dependencies

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

## Summary 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. ## Impact 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 Functionality Affected: - Request interceptor chains where an interceptor returns a new ordinary object. - Replacement config objects that omit an own `headers` property. - `dispatchRequest()` header normalization through `AxiosHeaders.from(config.headers)`. Not affected: - Requests whose interceptor preserves an own `headers` property. - Interceptors that mutate and return the existing null-prototype config. - Processes without prototype pollution. ## Technical Details `lib/core/dispatchRequest.js` contains: ```js 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`. ## Proof of Concept of Attack Constrained local demonstration: ```js 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`. ## Workarounds 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. <details> <summary><h3>Original report</h3></summary> ## Summary 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. ## Affected Version Validated on: - axios: `1.17.0` - commit: `4306df2` - runtime: Node.js `v24.15.0` ## Preconditions - A separate prototype-pollution primitive can write an object to `Object.prototype.headers`. - A request interceptor rebuilds config and omits own `headers`. ## Root Cause `dispatchRequest()` uses: ```js 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`. ## Impact 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. ## Proof of Concept ```js 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: ```json { "x-poisoned": "yes", "if-none-match": "*", "user-agent": "axios/1.17.0" } ``` ## References - https://github.com/axios/axios/security/advisories/GHSA-898c-q2cr-xwhg - https://osv.dev/vulnerability/GHSA-898c-q2cr-xwhg </details> ---

CVE-2026-101904 Affected Axios Versions

1 component(s)
Fixed Versions:
1.20.0
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?
CVE-2026-101904 is a security vulnerability in Axios involving Header Injection via Inherited headers After Minimal Interceptor under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution').
Which Axios versions are affected?
Affected versions include releases prior to 1.20.0 across affected packages: axios.
What version fixes CVE-2026-101904?
Upgrading to 1.20.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is axios affected?
Yes, axios is affected in releases prior to 1.20.0. Upgrade your dependency to 1.20.0 or later.
What CWE is associated with CVE-2026-101904?
CVE-2026-101904 is classified under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution') (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.).
How can I check npm dependencies for CVE-2026-101904?
Run the dependency tree command: 'npm ls axios'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}