Executive brief
Axios is a popular HTTP client library used in Node.js applications to make web requests. This vulnerability allows an attacker to bypass upload size limits (maxBodyLength) when streaming data with a specific configuration setting, potentially enabling them to upload excessively large files and exhaust server resources or cause denial-of-service attacks.
Technical details
This vulnerability is a resource exhaustion weakness (CWE-770) where Axios fails to enforce the maxBodyLength limit on streamed request bodies when maxRedirects is configured to 0. The root cause lies in lib/adapters/http.js: the maxBodyLength check (lines 556-564) only applies to buffered/non-stream data; when maxRedirects === 0, the native http/https transport is selected (lines 681-682); and the stream is piped directly to the socket without Axios-level byte counting (lines 925-945), bypassing the intended limit enforcement. An attacker can send a 2 MiB stream with maxBodyLength: 1024 and maxRedirects: 0, and it will be transmitted in full despite the configured limit. The vulnerability affects all versions up to and including Axios 1.15.0 and 0.31.0, with patches available in 1.15.1 and 0.31.1. No authentication or user interaction is required; the attack is network-accessible and occurs through a direct API call with specific parameters.
Affected products
- axios axios < 0.31.1 and 1.0.0 to <= 1.15.0
Timeline
- 2026-04-24: disclosed
- 2026-05-05: patched: Patches released in versions 1.15.1 and 0.31.1