CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-42036

CVE-2026-42036: maxContentLength Bypass and Resource Exhaustion in Axios

Alon Barad
Alon Barad
Software Engineer

May 5, 2026·6 min read·62 visits

Executive Summary (TL;DR)

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.

Vulnerability Overview

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.

Root Cause Analysis

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.

Code Analysis

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

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.

Impact Assessment

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.

Remediation

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.

Official Patches

AxiosGitHub Security Advisory

Fix Analysis (1)

Technical Appendix

CVSS Score
5.3/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
EPSS Probability
0.05%
Top 84% most exploited

Affected Systems

Node.js Applications using AxiosServices utilizing Axios for streaming external resources

Affected Versions Detail

Product
Affected Versions
Fixed Version
axios
Axios
< 0.31.10.31.1
axios
Axios
>= 1.0.0, < 1.15.11.15.1
AttributeDetail
CWE IDCWE-770
Attack VectorNetwork
CVSS Score5.3
EPSS Score0.00051
ImpactDenial of Service
Exploit StatusPoC
CISA KEVFalse

MITRE ATT&CK Mapping

T1499Endpoint Denial of Service
Impact
CWE-770
Allocation of Resources Without Limits or Throttling

Allocation of Resources Without Limits or Throttling

Known Exploits & Detection

Research ReportConceptual PoC relying on a basic HTTP server returning an unbounded stream

Vulnerability Timeline

Fix identified/implemented via follow-redirects bump
2026-04-07
Vulnerability officially disclosed and CVE-2026-42036 assigned
2026-04-24
Fixed versions 1.15.1 and 0.31.1 released
2026-04-24

References & Sources

  • [1]GHSA-vf2m-468p-8v99
  • [2]NVD Record
  • [3]CVE.org Record
  • [4]Fix Commit

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•10 minutes ago•CVE-2026-56818
6.5

CVE-2026-56818: Denial of Service via Memory Pinning in Netty Redis Array Aggregator

A vulnerability in Netty's Redis codec allows remote unauthenticated attackers to cause a memory-pinning Denial of Service (DoS) due to the failure to release partial aggregate state when specific error conditions occur in RedisArrayAggregator. When processing Redis Serialization Protocol (RESP) messages, the aggregator fails to clear internal queues and release retained direct byte buffers on exception paths triggered by exceeded maxElements or invalid length properties. If the pipeline does not explicitly tear down the connection upon detecting a decoder error, subsequent elements continue utilizing the stale context, allowing memory blocks to remain indefinitely pinned.

Amit Schendel
Amit Schendel
0 views•5 min read
•about 1 hour ago•CVE-2026-54164
6.5

CVE-2026-54164: Missing IRI Type Validation in API Platform Core Enables Resource Type Confusion

CVE-2026-54164 is a class/type confusion vulnerability (CWE-843) in API Platform Core. When processing relationships via Internationalized Resource Identifiers (IRIs) in write requests, the framework's normalizer fails to verify if the resolved resource matches the expected type. For PHP applications utilizing untyped properties, the mismatched object is silently assigned, breaking domain logic and data integrity.

Alon Barad
Alon Barad
1 views•6 min read
•about 2 hours ago•GHSA-WVPP-8HX9-P66J
9.8

GHSA-WVPP-8HX9-P66J: Arbitrary Command Execution via Option Guard Bypass in GitPython

An unsafe option guard bypass vulnerability exists in GitPython before version 3.1.58. When keyword arguments are passed to Git commands with split_single_char_options=False, GitPython's argument validation helper fails to inspect the combined short-option value. This discrepancy allows short-option token smuggling or clustering manipulation, enabling remote attackers to bypass option blocklists and execute arbitrary system commands.

Alon Barad
Alon Barad
3 views•8 min read
•about 3 hours ago•GHSA-WG23-69C2-GJC8
9.1

GHSA-WG23-69C2-GJC8: Passkey Login Replay Vulnerability in Craft CMS

GHSA-WG23-69C2-GJC8 is a critical security vulnerability discovered in the native Passkey (WebAuthn) login implementation of Craft CMS. The vulnerability allows an attacker to bypass WebAuthn's core cryptographic challenge-response and signature-counter replay protections. By intercepting a single successful passkey login request body, an attacker can replay the identical request payload to generate additional authenticated active sessions, resulting in complete account takeover.

Alon Barad
Alon Barad
2 views•6 min read
•about 4 hours ago•GHSA-JFM3-95JQ-Q3RF
7.5

GHSA-jfm3-95jq-q3rf: Algorithmic Complexity Denial of Service and Path-Delimiter Injection in league/commonmark Footnote Extension

An architectural flaw in the Footnote extension of league/commonmark allows unauthenticated remote attackers to trigger severe denial of service conditions through algorithmic complexity exploitation (O(N^2) CPU and memory exhaustion) and path-delimiter injection leading to unexpected application-level crashes.

Alon Barad
Alon Barad
2 views•8 min read
•about 5 hours ago•GHSA-MH25-X5HQ-WRQP
7.5

GHSA-MH25-X5HQ-WRQP: Algorithmic Complexity Denial of Service in league/commonmark UniqueSlugNormalizer

An algorithmic complexity vulnerability in the UniqueSlugNormalizer component of the league/commonmark PHP library allows unauthenticated remote attackers to trigger severe CPU resource consumption and Denial of Service (DoS) by submitting a Markdown document containing a high volume of duplicate headings. The slug generation loop resets its sequential search index back to 1 for every collision, resulting in a quadratic execution path. This flaw affects versions from 2.0.0-beta1 up to and including 2.8.3, and is patched in version 2.9.0.

Alon Barad
Alon Barad
1 views•6 min read