CVE-2026-42039
JavaScript vulnerability analysis and mitigation

Overview

CVE-2026-42039 is an uncontrolled recursion (DoS) vulnerability in the Axios HTTP client library for Node.js. The toFormData function recursively walks nested objects without any depth limit, causing a RangeError: Maximum call stack size exceeded that crashes the Node.js process when a deeply nested payload (~2000+ levels) is supplied as request data. It affects Axios versions up to and including 1.15.0 (1.x branch) and up to and including 0.31.0 (0.x branch). The vulnerability was published on April 24, 2026, and has a CVSS v3.1 base score of 7.5 (High) and a CVSS v4.0 base score of 6.9 (Medium) (Github Advisory, Axios Advisory).

Technical details

The root cause is classified as CWE-674 (Uncontrolled Recursion). In lib/helpers/toFormData.js, the inner build(value, path) function recurses into every object/array child without a maximum depth check — the only guard is a circular-reference detection stack, not a depth limit, and there is no try/catch around the recursion. Because toFormData is also the serializer behind AxiosURLSearchParams (used by buildURL when URLSearchParams is unavailable), any server-side code that forwards client-supplied JSON into axios({ data, params }) exposes the recursive walker to attacker-controlled nesting depth. A payload nested approximately 2,500 levels deep exhausts V8's call stack synchronously, causing the RangeError to propagate out of the axios request call and crash the request handler or the entire process (Github Advisory, Axios Advisory).

Impact

Successful exploitation results in a denial-of-service condition with no impact on confidentiality or integrity. In typical Express or Fastify proxy patterns where client JSON is forwarded through axios, the crash terminates the running request handler; in worker thread or cluster setups, it can bring down the entire Node.js process, making the service completely unavailable until restarted. The vulnerability is particularly impactful in applications that act as API gateways or reverse proxies, as a single unauthenticated HTTP request is sufficient to trigger the crash (Github Advisory).

Exploitability

A proof-of-concept exploit is publicly available in the official GitHub Security Advisory, providing a concrete, reproducible attack sequence verified on axios 1.15.0 and Node.js 20 (Axios Advisory). No authentication or special privileges are required, and no user interaction is needed. The EPSS score is approximately 0.031% (9th percentile), indicating a low but non-zero probability of exploitation in the near term. There is no evidence of active in-the-wild exploitation or threat actor attribution at this time, and the vulnerability is not listed in the CISA KEV catalog. Detection plugins are available via Nessus (ID 313224) and Qualys (ID 387394) (Github Advisory).

Exploitation steps

  1. Reconnaissance: Identify server-side Node.js applications that use a vulnerable version of axios (< 1.15.1 or < 0.31.1) and expose an HTTP endpoint that forwards client-supplied JSON body or query parameters directly into an axios request (the "vulnerable proxy pattern").
  2. Craft deeply nested payload: Construct a JSON object nested approximately 2,500 levels deep, e.g.:
{"a":{"a":{"a": ... /* 2500 levels */ ...}}}

This can be generated programmatically:

function nest(depth) {
  let o = { leaf: 1 };
  for (let i = 0; i < depth; i++) o = { a: o };
  return o;
}
console.log(JSON.stringify(nest(2500)));
  1. Send the malicious request: POST the deeply nested JSON payload to the vulnerable endpoint:
POST /forward HTTP/1.1
Content-Type: application/json

{"a":{"a":{"a": ... 2500 deep ...}}}
  1. Trigger crash: The server's axios call passes req.body to toFormData, which recursively walks the nested object, exhausting V8's call stack and throwing an uncaught RangeError: Maximum call stack size exceeded, crashing the request handler or the Node.js process (Axios Advisory).

Indicators of compromise

  • Network: Repeated HTTP POST requests with unusually large or deeply nested JSON bodies (Content-Length may be moderate but nesting depth is extreme); requests targeting proxy or forwarding endpoints from a single or rotating source IP.
  • Logs: Node.js process logs or application error logs showing RangeError: Maximum call stack size exceeded originating from toFormData.js or axios; sudden process restarts or crash dumps in PM2/systemd logs.
  • Process: Unexpected Node.js process termination or restart events; cluster worker respawn events in process managers (PM2, forever) correlated with specific HTTP request timestamps.
  • Application: HTTP 500 or 502 errors spiking on specific endpoints that proxy or forward request bodies through axios, particularly following receipt of requests with deeply nested JSON payloads (Axios Advisory).

Mitigation and workarounds

Upgrade Axios to version 1.15.1 (for the 1.x branch) or 0.31.1 (for the 0.x branch), which bound the recursion depth in toFormData's build function (Github Advisory). As a short-term workaround, validate and reject deeply nested JSON input at the application or middleware layer before it reaches axios (e.g., limit JSON nesting depth using a library like flat or a custom middleware). IBM has issued security bulletins for affected products including IBM App Connect Enterprise, IBM Cloud Pak for Integration, IBM Maximo Application Suite, IBM Voice Gateway, IBM Edge Application Manager, IBM Aspera Enterprise WebApps, IBM InfoSphere Optim Archive Viewer, IBM Business Automation Manager Open Editions, IBM License Metric Tool, and IBM watsonx Code Assistant On Prem — consult the respective IBM support pages for product-specific remediation (IBM ACE Advisory, IBM CP4I Advisory).

Community reactions

The vulnerability was reported by security researcher fg0x0 and published by axios maintainer jasonsaayman on April 24, 2026 (Axios Advisory). IBM issued multiple security bulletins across its product portfolio in May–June 2026, reflecting the broad downstream impact of the axios dependency. Red Hat also issued several errata (RHSA-2026:14937, RHSA-2026:16476, RHSA-2026:16535, RHSA-2026:16542, RHSA-2026:17657, RHSA-2026:21338, RHSA-2026:22619, RHSA-2026:25041, RHSA-2026:25089) addressing this CVE in their products. The vulnerability received moderate community attention given axios's widespread use across the Node.js ecosystem.

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Debian

Fixed

bookworm

node-axios

Affected

sid

node-axios: 1.15.2-1

Fixed

trixie

node-axios

Affected

Ubuntu

Unknown

devel

node-axios

Unknown

focal (esm-apps)

node-axios

Unknown

jammy

node-axios

Unknown

jammy (esm-apps)

node-axios

Unknown

noble

node-axios

Unknown

noble (esm-apps)

node-axios

Unknown

resolute

node-axios

Unknown

resolute (esm-apps)

node-axios

Unknown

RHEL / CentOS

Fixed

OpenShift

el9:openshift4/ose-agent-installer-ui-rhel9-0:v4.20.0

Fixed

RHEL 8

grafana.src

Affected

RHEL 9

Not Affected

SourceThis report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-54504HIGH8.8
  • JavaScript logoJavaScript
  • @andrea9293/mcp-documentation-server
NoYesSep 17, 2026
CVE-2026-77615HIGH8.7
  • JavaScript logoJavaScript
  • paella-core
NoYesSep 17, 2026
CVE-2026-91127HIGH8.2
  • JavaScript logoJavaScript
  • @file-viewer/doc
NoYesSep 18, 2026
CVE-2026-77301HIGH7.5
  • JavaScript logoJavaScript
  • adm-zip
NoYesSep 18, 2026
CVE-2026-84992MEDIUM6.1
  • JavaScript logoJavaScript
  • md-editor-v3
NoYesSep 18, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management