All vulnerabilities

npm

CVE-2026-67313

Axios: Excessive recursion in formDataToJSON can cause denial of service

Severity
Medium
Published
20 Jul 2026
Last changed
10 Sept 2026
Added to UpHeron
22 Oct 2026
Fixed in
0.33.0, 1.18.0
Exploit chance
0.5% in the next 30 daysHigher than 45% of CVEs. EPSS by FIRST, 19 Nov 2026
Weakness
Uncontrolled resource consumption (CWE-400)Uncontrolled recursion (CWE-674)
Also known as
GHSA-42h9-826w-cgv3
Sources
OSV.dev and GitHub

Description

Axios versions 0.28.0 and later contain uncontrolled recursion in formDataToJSON, the helper behind the public axios.formToJSON() / named formToJSON API and the default request transform used when FormData is sent with an application/json content type.

Applications are affected when they pass attacker-controlled FormData field names into this functionality. A field name with thousands of nested bracket segments can exhaust the JavaScript call stack and throw RangeError: Maximum call stack size exceeded, causing request failure and, in applications that do not handle the exception or rejected promise, possible process termination.

The impact is denial of service against applications that process untrusted FormData field names through axios' FormData-to-JSON conversion.

The vulnerable path is not reached by merely installing axios, by normal multipart FormData pass-through, or by ordinary axios requests that do not request JSON serialisation of FormData.

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Workarounds

Applications can avoid the vulnerable path by not converting attacker-controlled FormData to JSON with axios.

If conversion is required before a fixed axios release is available, validate FormData field names before calling formToJSON() or before sending FormData with Content-Type: application/json. Reject keys whose parsed nesting depth exceeds the application's expected schema.

For axios requests carrying untrusted FormData, avoid setting Content-Type: application/json; leaving the data as multipart FormData bypasses formDataToJSON().

Workarounds as given by the GitHub Advisory Database, CC BY 4.0.

Affected software

SoftwareAffected versions
axiosnpm · osv:npm:axios
  • From 0.28.0 before 0.33.0
  • From 1.0.0 before 1.18.0

About axios

Weekly downloads (npm)
143,624,637npm, 16 Nov 2026

References