May 5, 2026·6 min read·83 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-2026-72807 is a second-order SQL injection vulnerability in SiYuan versions prior to v3.7.4. It resides in the dynamic evaluation of Attribute View (AV) template columns, which expose unsafe template functions. An attacker can exploit this by distributing a malicious SiYuan package that executes arbitrary SQL queries on the victim's local database.
An authorization bypass vulnerability in SiYuan prior to v3.7.4 allows unauthenticated remote attackers to access rows, block IDs, and custom attributes of password-protected documents via the attribute view rendering endpoint.
SiYuan Note versions before v3.7.4 fail to enforce publish-access checks on several block API endpoints. This vulnerability allows anonymous readers or authorized accounts with low-privileged roles to retrieve sensitive document titles, ancestor block content snippets, reference text, and path metadata for publish-forbidden or password-protected documents by supplying target block IDs.
SiYuan before version 3.7.4 contains an authentication bypass vulnerability within its graph visualization API endpoints, allowing unauthenticated remote attackers to extract sensitive node metadata and content from password-protected documents.
SiYuan Note versions prior to v3.7.4 contain an information disclosure vulnerability in the `/api/asset/resolveAssetPath` endpoint. This endpoint returns absolute backend filesystem paths unmodified to CheckAuth-only requests. Low-privileged users or unauthenticated readers under publish mode can exploit this to leak the local directory layout, operating system username, and overall host deployment structure.
An access control vulnerability in the SiYuan personal knowledge management platform before version v3.7.4 exposes notebook encryption parameters to unauthenticated remote attackers. When the platform is configured in Publish Mode, specific API endpoints fail to enforce authorization checks. This access failure leaks key-derivation materials, password verifiers, and wrapped database keys to anonymous network clients.