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-42039

CVE-2026-42039: Uncontrolled Recursion Denial of Service in Axios toFormData

Alon Barad
Alon Barad
Software Engineer

May 5, 2026·7 min read·124 visits

Executive Summary (TL;DR)

Uncontrolled recursion in Axios `toFormData` allows attackers to cause a Denial of Service (DoS) by crashing the Node.js process with a stack overflow when parsing deeply nested JSON objects.

CVE-2026-42039 is a high-severity Denial of Service (DoS) vulnerability in the Axios HTTP client library. The flaw exists in the `toFormData` utility due to uncontrolled recursion during object serialization, allowing attackers to crash Node.js processes via deeply nested objects.

Vulnerability Overview

CVE-2026-42039 is a high-severity Denial of Service (DoS) vulnerability in Axios, a widely utilized promise-based HTTP client for Node.js and browser environments. The vulnerability originates in the toFormData utility function, which serializes nested JavaScript objects into multipart/form-data or URL-encoded formats. This function is invoked implicitly when developers pass JavaScript objects to HTTP methods with specific content types or as URL parameters.

The root cause is classified as CWE-674: Uncontrolled Recursion. The internal build helper function, responsible for traversing the input object tree, processes nested properties recursively without an explicit depth limit. This implementation assumes that object structures will remain within typical usage boundaries and relies on standard execution stack capacities.

When an attacker submits a maliciously crafted, highly nested JSON object, the recursive traversal continues indefinitely until it exhausts the finite call stack of the JavaScript engine. In server-side Node.js applications, this stack exhaustion throws a synchronous RangeError: Maximum call stack size exceeded exception. Unless explicitly caught by wrapping the Axios call in a defensive try-catch block, this unhandled exception terminates the Node.js process entirely, fulfilling the conditions for a Denial of Service.

Root Cause Analysis

The vulnerability resides within the lib/helpers/toFormData.js module, specifically in the internal build function. This function takes an input value, an accumulated path array, and recursively breaks down complex objects into flat key-value pairs suitable for HTTP form submission. Prior to the patch, the function logic verified object types and managed circular references using a stack array, but omitted tracking for recursive descent depth.

JavaScript engines, including V8 used by Node.js, allocate a finite amount of memory for the execution call stack. Each invocation of the build function consumes a stack frame to store local variables, arguments, and return addresses. Without a depth limit, an object nested to thousands of levels forces the engine to allocate a proportional number of stack frames.

While the implementation successfully mitigates infinite loops caused by circular object references, a linear nested structure bypasses this protection. The circular reference check only prevents processing identical object references multiple times. A deeply nested tree of distinct objects evades this check entirely, progressing until the engine's hard limits are reached.

Once the call stack limit is breached, the V8 engine synchronously aborts the current operation and throws a RangeError. Because Axios invokes this serialization process synchronously during request configuration, the exception propagates up the call stack immediately. If the calling application lacks rigorous unhandled exception management, the entire server process crashes.

Code Analysis

The vulnerability is resolved by introducing an explicit maxDepth limit during the recursive traversal. The patch modifies lib/helpers/toFormData.js to track the current depth level and abort operations that exceed a configurable threshold.

// Pre-patch vulnerable implementation
function build(value, path) {
  if (utils.isUndefined(value)) return;
  // ... (circular reference tracking via stack)
  
  // Recursive call lacks depth tracking
  build(el, path ? path.concat(key) : [key]);
}

The patched version introduces the maxDepth option, defaulting to 100 levels. The build signature is updated to accept a depth integer, incremented by one on each recursive descent. If depth exceeds maxDepth, the function throws a controlled AxiosError instead of allowing the engine to exhaust the call stack.

// Post-patch secure implementation
const maxDepth = options.maxDepth === undefined ? 100 : options.maxDepth;
 
function build(value, path, depth = 0) {
  if (utils.isUndefined(value)) return;
 
  // Depth guard prevents stack exhaustion
  if (depth > maxDepth) {
    throw new AxiosError(
      'Object is too deeply nested (' + depth + ' levels). Max depth: ' + maxDepth,
      AxiosError.ERR_FORM_DATA_DEPTH_EXCEEDED
    );
  }
  // ... (circular reference tracking)
  
  // Recursive call with incremented depth
  build(el, path ? path.concat(key) : [key], depth + 1);
}

This remediation ensures that serialization aborts gracefully. The controlled error returned by Axios can be handled via standard Promise rejection pathways, preserving process stability while rejecting malformed inputs.

Exploitation

Exploiting this vulnerability requires an application to ingest untrusted user input and subsequently pass it to Axios for outbound network requests. The attacker must control the structure of the data payload. Typical exploitation scenarios involve applications proxying user requests to third-party APIs or internal microservices.

The attacker crafts a payload utilizing extreme structural nesting. By formatting a JSON payload where a single key continuously points to a child object, the attacker constructs a linear chain of references. In practical testing, a nesting depth of approximately 2,000 to 2,500 levels consistently triggers the stack exhaustion limit in standard Node.js environments.

const axios = require('axios');
 
// Construct malicious payload with 2500 depth levels
let data = { leaf: "value" };
for (let i = 0; i < 2500; i++) {
    data = { a: data };
}
 
// Trigger vulnerability
try {
    axios.post('https://example.com/api', data, {
        headers: { 'Content-Type': 'multipart/form-data' }
    });
} catch (e) {
    console.error(e); // RangeError: Maximum call stack size exceeded
}

The server receives this object, parses the JSON structure without issue, and forwards the parsed object to Axios. When Axios attempts to serialize the payload for the outbound request, the uncontrolled recursion triggers the process crash. The exploit demands no authentication unless the vulnerable application endpoint requires it, operating entirely over network vectors.

Impact Assessment

The primary security impact of CVE-2026-42039 is Denial of Service. In Node.js environments, unhandled exceptions resulting from stack exhaustion terminate the running process. An attacker capable of submitting malformed requests continuously can keep the target service offline, leading to total availability loss for the affected component.

While the vulnerability exists in the shared codebase utilized by both Node.js and browser environments, the practical impact diverges significantly. In a browser context, the crash is isolated to the client's current tab or web worker. This local crash limits the attack scope to degrading the individual user's experience rather than compromising infrastructure.

The CVSS v3.1 vector evaluates to 7.5 (High) via CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H. The attack requires low complexity, no privileges, and operates over the network. The impact is isolated strictly to availability; the vulnerability offers no pathways for confidentiality breaches, data integrity modification, or remote code execution.

Threat intelligence indicates that while proof-of-concept exploits are publicly available, no active weaponization campaigns currently target this flaw. The EPSS score is exceptionally low at 0.00052, reflecting the targeted nature of the vulnerability. Only applications specifically configured to forward user-provided objects via multipart/form-data or URL encoding routines are susceptible.

Remediation Guidance

The standard remediation path requires updating the axios dependency to version 1.15.1 or 0.31.1. These versions incorporate the recursive depth limit natively, defaulting to a maximum depth of 100 levels. Upgrading replaces the unhandled stack exception with a controlled asynchronous rejection, allowing the application code to handle the error normally.

If immediate dependency updates are not feasible, development teams must implement input validation at the application boundary. Validating incoming JSON requests to ensure maximum object depth stays below 50 levels mitigates the vector before the data reaches the Axios client. This can be achieved through custom middleware or robust schema validation libraries.

For unique use cases requiring extensive data nesting beyond the new 100-level limit, developers can override the threshold via the formSerializer configuration option. Modifying this value should be done meticulously, as allocating excessively high limits restores the vulnerability profile.

// Modifying the limit only when strictly necessary
axios.post('https://example.com/api', largeValidObject, { 
    formSerializer: { maxDepth: 250 } 
});

Setting maxDepth: Infinity intentionally disables the security control and is strongly discouraged. Security teams should scan codebases for this anti-pattern during code review to ensure the mitigation remains effective.

Official Patches

GitHub AdvisoryVendor Advisory

Fix Analysis (2)

Technical Appendix

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

Affected Systems

Node.js backends using AxiosBrowsers executing Axios (though impact is limited to the current tab)APIs proxying user data via Axios

Affected Versions Detail

Product
Affected Versions
Fixed Version
axios
< 0.31.1-
axios
>= 1.0.0, < 1.15.1-
AttributeDetail
CWECWE-674
CVSS7.5
Attack VectorNetwork
ImpactDenial of Service
Exploit StatusPoC Available
EPSS Score0.00052

MITRE ATT&CK Mapping

T1499Endpoint Denial of Service
Impact
CWE-674
Uncontrolled Recursion

Uncontrolled Recursion

Vulnerability Timeline

Initial internal discovery of the recursion issue.
2026-04-07
Official security advisory and fix released in Axios 1.15.1 and 0.31.1.
2026-04-15
Public disclosure and CVE ID assignment.
2026-04-24
Last update to EPSS scores and threat intelligence tracking.
2026-05-04

References & Sources

  • [1]Vendor Advisory GHSA-62hf-57xw-28j9
  • [2]Snyk Vulnerability Database
  • [3]NVD Record

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

•less than a minute ago•CVE-2026-119793
7.5

CVE-2026-119793: Unbounded Topic Map Allocation Denial of Service in js-libp2p GossipSub

CVE-2026-119793 (GHSA-x2vm-cf3p-m2w8) is a resource consumption vulnerability in the @libp2p/gossipsub module of the js-libp2p ecosystem. Prior to @libp2p/gossipsub version 17.0.0 and js-libp2p version 3.3.9, the GossipSub implementation processed incoming subscription RPC messages without enforcing per-peer or global limits on the number or cumulative byte size of subscribed topics in its default configuration. An unauthenticated remote peer can exploit this flaw by streaming continuous batches of unique topic subscription strings over an established connection, causing unbounded growth of the internal topics Map. This leads to V8 heap exhaustion (Out-Of-Memory crash) and severe CPU starvation on the main event loop during peer disconnection teardown.

Amit Schendel
Amit Schendel
0 views•12 min read
•about 1 hour ago•CVE-2026-69241
5.4

CVE-2026-69241: Stored Cross-Site Scripting via Unsanitized SVG Upload in Filament Curator

Filament Curator, a media picker plugin for Filament panels in Laravel applications, contains a Stored Cross-Site Scripting (XSS) vulnerability in versions prior to 3.7.9, 4.1.2, and 5.1.2. The application accepts image/svg+xml uploads by default and stores them on disk without stripping executable XML markup. When a panel user opens an uploaded SVG via the View action, the file renders as a top-level document in the browser, executing embedded JavaScript within the origin of the Filament application.

Alon Barad
Alon Barad
3 views•9 min read
•about 4 hours ago•CVE-2026-63182
8.1

CVE-2026-63182: XML Signature Wrapping Authentication Bypass in LightSAML

CVE-2026-63182 is a high-severity XML Signature Wrapping (XSW) vulnerability in LightSAML (litesaml/lightsaml), a PHP library implementing SAML 2.0 data models and cryptographic verification. An architectural discrepancy between how LightSAML deserializes direct child assertions and how the underlying robrichards/xmlseclibs library resolves XML document fragment identifiers allows an attacker with a valid signed assertion to forge arbitrary SAML identity claims and bypass authentication.

Alon Barad
Alon Barad
4 views•11 min read
•about 5 hours ago•CVE-2026-119351
6.3

CVE-2026-119351: Cross-Context Cache Leak via Delayed Inner Stream Metadata in Next.js

A race condition and improper synchronization vulnerability (CWE-362) exists in Next.js versions 16.2.0 prior to 16.4.5 when Cache Components ('use cache' directive) are enabled. When an outer cached function calls a nested cached function that reads dynamic root parameters via 'next/root-params' and returns an object containing pending promises, React Flight can resolve and deliver the ready portion of the payload before the inner cache finishes publishing its root parameter dependencies. Consequently, the outer cache entry finalizes and persists under a cache key that omits the root parameter dependencies, causing the first written cache entry to be served across requests with different root parameter values and bypassing nested cache invalidation rules.

Amit Schendel
Amit Schendel
7 views•10 min read
•about 6 hours ago•CVE-2026-68934
8.7

CVE-2026-68934: OS Command Injection in code-review-mcp-server via Unsafe Shell Execution

A remote OS command injection vulnerability (CWE-78) exists in code-review-mcp-server prior to version 1.5.3. The application passes caller-controlled tool parameters directly into Node.js child_process.execSync() calls without proper neutralization. An attacker or compromised LLM agent invoking tools such as getLocalGitDiff, codeReview, createPR, or getPRTemplate can inject arbitrary shell commands that execute with the privileges of the MCP server host process.

Alon Barad
Alon Barad
9 views•11 min read
•about 7 hours ago•CVE-2026-86046
7.1

CVE-2026-86046: Arbitrary File Write via Path Traversal in termux-sync Restore Workflow

A path traversal vulnerability (CWE-22) in termux-sync prior to version 1.2.4 allows an attacker to overwrite arbitrary files within the Termux environment during the backup restoration process. The flaw stems from the application trusting attacker-controlled extraction paths defined in the backup's manifest.json file, failing to validate archive members against directory traversal sequences during tar extraction, and using unsanitized backup names when constructing temporary directories. If a user restores a malicious backup archive from local storage, shared folders, GitHub, or Google Drive, an attacker can overwrite sensitive configuration files such as shell startup scripts or local binaries, resulting in arbitrary code execution under the privileges of the Termux user.

Amit Schendel
Amit Schendel
6 views•11 min read