All vulnerabilities

npm

CVE-2026-67312

Axios: Deep formToJSON Key Recursion 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)Allocation without limits (CWE-770)
Also known as
GHSA-pmv8-rq9r-6j72
Sources
OSV.dev and GitHub

Description

Axios versions starting with 0.28.0 contain uncontrolled recursion in formDataToJSON, which is exposed as axios.formToJSON() and used internally when axios serialises FormData with Content-Type: application/json.

If an application passes attacker-controlled FormData field names to this functionality, a field name with thousands of nested bracket segments can exhaust the JavaScript call stack and cause denial of service for that request or, in applications without appropriate error handling, process termination.

Applications are affected only when untrusted users can control FormData key names that are converted through axios.

Affected paths include direct use of axios.formToJSON() on untrusted FormData and axios requests in which attacker-controlled FormData is sent with Content-Type: application/json.

The observed failure is RangeError: Maximum call stack size exceeded. In local testing, this error is catchable, so process-wide crash depends on the consuming application's error…

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

Workarounds

Applications can reject or normalise untrusted form field names before calling axios.formToJSON().

Applications can avoid sending untrusted FormData through axios as JSON unless JSON conversion is required.

Applications should catch errors around formToJSON() or axios requests that transform untrusted FormData.

Original Source

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