When responseType: 'stream' is used, Axios returns the response stream without enforcing maxContentLength. This bypasses configured response-size limits and allows unbounded downstream consumption.
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.
Environment: - Axios main at commit f7a4ee2 - Node v24.2.0
Steps:
Observed: - Success; full 2097152 bytes readable.
Control check: - Same endpoint with responseType: 'text' and same maxContentLength: rejected with maxContentLength size of 1024 exceeded.
Type: DoS / unbounded response processing. Impacted: Node.js applications relying on maxContentLength as a safety boundary while using streamed Axios responses.
{
"github_reviewed": true,
"github_reviewed_at": "2026-05-05T00:26:57Z",
"cwe_ids": [
"CWE-770"
],
"severity": "MODERATE",
"nvd_published_at": "2026-04-24T18:16:30Z"
}