Axios: Deep formToJSON Key Recursion Can Cause Denial of Service
Axios versions starting from 0.28.0 up to but not including 0.33.0, and versions from 1.0.0 up to but not including 1.18.0, contain an uncontrolled recursion vulnerability in the formDataToJSON function. This vulnerability occurs when attacker-controlled FormData key names with thousands of nested bracket segments cause excessive recursive calls, leading to a JavaScript call stack overflow and denial of service. The issue manifests as a RangeError that can crash the process if not properly handled. Normal multipart FormData submissions and axios versions prior to 0.28.0 are not affected.
AI Analysis
Technical Summary
The vulnerability exists in the axios library's formDataToJSON function, exposed as axios.formToJSON and used internally when serializing FormData with Content-Type: application/json. The function recursively processes bracket-delimited segments of FormData key names without enforcing a maximum recursion depth, allowing an attacker to craft keys with thousands of nested segments (e.g., 'a[x][x][x]...') that exhaust the JavaScript call stack. This leads to a RangeError: Maximum call stack size exceeded, causing denial of service by crashing the Node.js process or failing the request. The inverse function toFormData enforces a maxDepth guard, but formDataToJSON lacks this protection. The vulnerability affects axios versions >=0.28.0 <0.33.0 and >=1.0.0 <1.18.0. Exploitation requires attacker control over FormData key names that are JSON serialized by axios.
Potential Impact
Applications using affected axios versions that accept untrusted FormData key names and serialize them to JSON are vulnerable to denial of service via call stack exhaustion. The impact is a RangeError causing request failure or process termination depending on error handling. This can disrupt service availability but does not directly lead to code execution or data breach. The vulnerability is limited to scenarios where attacker-controlled FormData keys are processed through axios.formToJSON or axios requests with Content-Type: application/json and FormData payloads.
Mitigation Recommendations
No official patch information is provided in the source data. Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. In the meantime, applications should reject or normalize untrusted FormData key names before passing them to axios.formToJSON. Avoid sending untrusted FormData through axios as JSON unless necessary. Implement error handling to catch exceptions from formToJSON or axios requests that transform untrusted FormData to prevent process crashes.
Axios: Deep formToJSON Key Recursion Can Cause Denial of Service
Description
Axios versions starting from 0.28.0 up to but not including 0.33.0, and versions from 1.0.0 up to but not including 1.18.0, contain an uncontrolled recursion vulnerability in the formDataToJSON function. This vulnerability occurs when attacker-controlled FormData key names with thousands of nested bracket segments cause excessive recursive calls, leading to a JavaScript call stack overflow and denial of service. The issue manifests as a RangeError that can crash the process if not properly handled. Normal multipart FormData submissions and axios versions prior to 0.28.0 are not affected.
CVSS v4.0
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability exists in the axios library's formDataToJSON function, exposed as axios.formToJSON and used internally when serializing FormData with Content-Type: application/json. The function recursively processes bracket-delimited segments of FormData key names without enforcing a maximum recursion depth, allowing an attacker to craft keys with thousands of nested segments (e.g., 'a[x][x][x]...') that exhaust the JavaScript call stack. This leads to a RangeError: Maximum call stack size exceeded, causing denial of service by crashing the Node.js process or failing the request. The inverse function toFormData enforces a maxDepth guard, but formDataToJSON lacks this protection. The vulnerability affects axios versions >=0.28.0 <0.33.0 and >=1.0.0 <1.18.0. Exploitation requires attacker control over FormData key names that are JSON serialized by axios.
Potential Impact
Applications using affected axios versions that accept untrusted FormData key names and serialize them to JSON are vulnerable to denial of service via call stack exhaustion. The impact is a RangeError causing request failure or process termination depending on error handling. This can disrupt service availability but does not directly lead to code execution or data breach. The vulnerability is limited to scenarios where attacker-controlled FormData keys are processed through axios.formToJSON or axios requests with Content-Type: application/json and FormData payloads.
Mitigation Recommendations
No official patch information is provided in the source data. Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. In the meantime, applications should reject or normalize untrusted FormData key names before passing them to axios.formToJSON. Avoid sending untrusted FormData through axios as JSON unless necessary. Implement error handling to catch exceptions from formToJSON or axios requests that transform untrusted FormData to prevent process crashes.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-pmv8-rq9r-6j72
- Osv Schema Version
- 1.4.0
- Aliases
- []
- Ecosystems
- ["npm"]
- Database Specific Severity
- MODERATE
- Cvss Version
- 4.0
Threat ID: 6a5e79ef2a4a8d59899bc269
Added to database: 07/20/2026, 19:41:35 UTC
Last enriched: 07/20/2026, 19:49:27 UTC
Last updated: 07/21/2026, 05:05:48 UTC
Views: 10
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.