GitHub Advisoryadvisory · npm

GHSA-vf2m-468p-8v99 Axios: HTTP adapter streamed responses bypass maxContentLength

MEDIUM Published 2026-05-05 Modified 2026-05-05 Official page ↗
Aliases
CVE-2026-42036
Ecosystem
npm
Packages
axios
Severity
Moderate
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
Weaknesses
CWE-770
Reviewed
2026-05-05

Affected packages

• npm axios: >= 1.0.0, < 1.15.1 → fixed in 1.15.1 • npm axios: < 0.31.1 → fixed in 0.31.1

Description

Summary When responseType: 'stream' is used, Axios returns the response stream without enforcing maxContentLength. This bypasses configured response-size limits and allows unbounded downstream consumption. Details In lib/adapters/http.js: • 786-789: for responseType === 'stream', Axios immediately settles with the stream. • 797-810: maxContentLength enforcement exists only in the non-stream buffering branch. So callers may set maxContentLength and still receive/read arbitrarily large streamed responses. PoC Environment: • Axios main at commit f7a4ee2 • Node v24.2.0 Steps: 1. Start an HTTP server that returns a 2 MiB response body. 2. Call Axios with: • adapter: 'http' • responseType: 'stream' • maxContentLength: 1024 3. Read the returned stream fully. Observed: • Success; full 2097152 bytes readable. Control check: • Same endpoint with responseType: 'text' and same maxContentLength: rejected with maxContentLength size of 1024 exceeded. Impact Type: DoS / unbounded response processing. Impacted: Node.js applications relying on maxContentLength as a safety boundary while using streamed Axios responses.

Related

Alias · CVE (1)

  • CVE-2026-42036 Axios is a promise based HTTP client for the browser and Node.js. vulnerability

Weakness · CWE (1)

  • CWE-770 Allocation of Resources Without Limits or Throttling weakness

References