May 5, 2026·6 min read·36 visits
Axios fails to enforce response size limits on streams, allowing an attacker to supply infinite data streams that bypass configured boundaries and cause local resource exhaustion.
A resource exhaustion vulnerability exists in the Axios Node.js HTTP client where the maxContentLength configuration is not enforced for stream responses, potentially causing Denial of Service.
Axios is a promise-based HTTP client for the browser and Node.js. It provides the maxContentLength configuration option to protect applications from unbounded responses by defining a maximum acceptable response body size. This mechanism is critical for preventing resource exhaustion when interacting with untrusted external servers.
Prior to versions 1.15.1 and 0.31.1, the Axios Node.js adapter fails to enforce the maxContentLength limit when a request specifies responseType: 'stream'. The library returns the response stream to the caller without applying the byte-counting constraints that are normally enforced for buffered response types.
This vulnerability is classified under CWE-770 (Allocation of Resources Without Limits or Throttling). By serving an infinite or excessively large data stream, a malicious server can bypass the intended safety boundaries of the Axios client. This condition allows unbounded downstream consumption, leading to local resource exhaustion.
The root cause resides in the Axios Node.js HTTP adapter implementation (lib/adapters/http.js). The library enforces maxContentLength within the code path responsible for buffering response data. When handling standard response types like json, text, or arraybuffer, Axios aggregates data chunks into memory and continuously verifies the cumulative byte count against the configured threshold.
When responseType: 'stream' is used, the HTTP adapter delegates the request to the follow-redirects package, which acts as a wrapper for the native Node.js http and https modules. Upon receiving the initial HTTP response headers, Axios immediately resolves the request promise. This returns the raw IncomingMessage object, which implements the ReadableStream interface, directly to the calling application.
Because the promise settles before data consumption begins, Axios bypasses the buffering logic entirely. Consequently, the byte-counting enforcement mechanism is never engaged. The application receives a raw stream that continues to emit data events regardless of the maxContentLength configuration, effectively shifting the responsibility of size validation to the downstream consumer.
The vulnerability is patched by updating the underlying follow-redirects dependency to version 1.16.0. Axios relies on follow-redirects for native HTTP/HTTPS handling and redirection logic. The vulnerability ultimately stems from a lack of stream-level size enforcement within this dependency chain when passing the raw socket to the caller.
In the vulnerable configuration, Axios initiates the request but does not inject stream-level constraints into the returned IncomingMessage. The fix in commit 770f5ef0811fc6ec8e7cea4ff40eb83542957bc3 bumps the follow-redirects dependency. The updated follow-redirects version implements internal byte-monitoring logic associated with its maxBodyLength parameter, which maps directly to the Axios maxContentLength configuration.
With the dependency updated, follow-redirects enforces the byte limit directly on the socket stream. When the received byte count exceeds the threshold, the library emits a 'maxBodyLength exceeded' error and proactively destroys the underlying TCP socket. This prevents the Node.js process from continuing to download the oversized payload.
// Package lock structural change reflecting the mitigation
// Vulnerable
"dependencies": {
"follow-redirects": "^1.15.0"
}
// Patched
"dependencies": {
"follow-redirects": "^1.15.6" // Resolves to >= 1.16.0 containing the fix
}Exploitation requires the attacker to control the HTTP server responding to an Axios client request. The target application must explicitly configure the Axios request with responseType: 'stream' and define a maxContentLength value. This setup is common in applications that proxy downloads or process large files iteratively to save memory.
The attacker configures their malicious HTTP server to accept incoming connections and respond with an endless stream of garbage data or a payload significantly larger than the expected file size. Because the client library fails to terminate the connection upon reaching the maxContentLength limit, the server can sustain the data transmission indefinitely.
> [!NOTE]
> A standard Node.js server using res.write() in a continuous loop is sufficient to trigger the vulnerability.
The Axios client resolves the response promise upon receiving the headers and passes the stream to the application logic. The application processes the incoming data chunks, resulting in sustained CPU usage, memory accumulation, or disk space consumption depending on how the application handles the emitted data.
The primary security impact is Denial of Service (DoS) through resource exhaustion. Depending on how the application handles the returned stream, an attacker can exhaust different system resources. The CVSS v3.1 base score is 5.3 (Medium), reflecting a partial loss of availability with no confidentiality or integrity impact.
If the application pipes the Axios response stream directly to the local filesystem using fs.createWriteStream, an attacker can exhaust available disk space. This can lead to system-wide instability, preventing logging mechanisms, databases, and other applications from functioning correctly.
If the downstream application buffers the stream chunks into memory, the attack will cause rapid memory consumption, eventually triggering an Out-Of-Memory (OOM) crash in the Node.js process. Continuous processing of an endless stream also monopolizes the event loop, causing CPU exhaustion and degrading the application's ability to service legitimate requests.
The official remediation is to update the Axios library to a patched version. Maintainers released versions 1.15.1 and 0.31.1 to address the vulnerability. These releases include the necessary dependency updates to follow-redirects that introduce native stream-level size enforcement.
For environments where immediate upgrading is not feasible, developers must implement a manual stream wrapper. This involves piping the Axios response stream through a custom Transform stream that increments a byte counter on each chunk. If the counter exceeds the expected limit, the custom stream must call stream.destroy() on the incoming response to terminate the TCP connection immediately.
Developers should ensure that downstream consumers of Axios streams implement their own resource constraints. Relying solely on the HTTP client for size validation is insufficient defense-in-depth. All file system writes and memory buffers handling external data must enforce strict maximum size policies.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L| Product | Affected Versions | Fixed Version |
|---|---|---|
axios Axios | < 0.31.1 | 0.31.1 |
axios Axios | >= 1.0.0, < 1.15.1 | 1.15.1 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-770 |
| Attack Vector | Network |
| CVSS Score | 5.3 |
| EPSS Score | 0.00051 |
| Impact | Denial of Service |
| Exploit Status | PoC |
| CISA KEV | False |
Allocation of Resources Without Limits or Throttling
CVE-2024-29203 identifies a cross-site scripting (XSS) vulnerability in the content ingestion and parsing mechanics of TinyMCE rich text editor. Due to a failure to enforce sandbox attributes on dynamic iframe elements and safely handle legacy embed objects, unauthenticated attackers can inject malicious elements that execute scripts within the context of the parent application session.
A technical breakdown of the OS command injection vulnerability in the shell-quote NPM package (CVE-2026-9277 / GHSA-w7jw-789q-3m8p). The bug resides in the character-by-character backslash-escaping logic applied to the .op field of object-tokens within the quote() function, which fails to match and escape line terminators due to a regex matching oversight in JavaScript. This allows unauthenticated remote attackers to execute arbitrary shell commands if they can control inputs processed by this library.
A high-severity memory corruption vulnerability exists in the V8 JavaScript engine of Google Chrome before versions 149.0.7827.102/103. The flaw arises from an incorrect bounds-check elimination during JIT compilation by the TurboFan optimizer, allowing remote attackers to achieve out-of-bounds read and write access inside the sandboxed renderer process.
An improper authentication vulnerability (CWE-287) exists in the legacy, deprecated Internet Key Exchange version 1 (IKEv1) key exchange protocol implementation in Check Point Security Gateways. The vulnerability is caused by a logic flow weakness during the certificate validation process for Remote Access VPN and Mobile Access (SSL VPN) connections. An unauthenticated remote attacker can exploit this weakness to bypass user authentication entirely, establishing a fully functional Remote Access VPN connection without a valid password.
GeoNode versions prior to 4.4.5 and 5.0.2 are vulnerable to Server-Side Request Forgery (SSRF) in the service registration endpoint. Authenticated attackers with low privileges can exploit insufficient input validation in the Web Map Service (WMS) registration module to force the application server to make outbound network queries to loopback addresses, private RFC1918 subnets, link-local scopes, and cloud metadata endpoints. This technical report details the mechanics of the vulnerability, the underlying architectural flaw, and how to effectively remediate and mitigate the associated security risks.
CVE-2022-0492 is a high-severity missing authorization vulnerability in the Linux kernel's Control Groups (cgroups) v1 implementation. The flaw resides within the cgroup_release_agent_write function in kernel/cgroup/cgroup-v1.c, where the kernel fails to validate if the process writing to the release_agent file possesses administrative capabilities in the initial user namespace. This allows a local attacker inside a container with root privileges (UID 0) to abuse user namespaces, mount a cgroups v1 directory, modify the release_agent parameter, and execute arbitrary commands on the host system as host root, effectively achieving a complete container escape.