Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

Axios: Excessive recursion in formDataToJSON can cause denial of service

0
Medium
Published: 07/20/2026 (07/20/2026, 17:58:59 UTC)
Source: GCVE Database
Product: axios

Description

Axios versions 0.28.0 and later contain a vulnerability in the formDataToJSON helper function that causes uncontrolled recursion when processing FormData field names with deeply nested bracket segments. This can lead to a denial of service by exhausting the JavaScript call stack and throwing a RangeError. The issue affects applications that convert attacker-controlled FormData to JSON, particularly when using axios.formToJSON() or sending FormData with Content-Type application/json. Normal multipart FormData requests without JSON serialization are not affected. The vulnerability can cause request failures and potentially process termination if exceptions are not handled.

CVSS v4.0

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vuln. Confidentiality
None
Vuln. Integrity
None
Vuln. Availability
Low
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N

Affected software

npmghsa
axios
Affected versions
>=0.28.0 <0.33.0
npmghsa
axios
Affected versions
>=1.0.0 <1.18.0

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

AILast updated: 07/20/2026, 19:48:43 UTC

Technical Analysis

Axios introduced a helper function formDataToJSON in version 0.28.0 that converts FormData to JSON by parsing field names into path segments and recursively building the JSON object. The recursion depth is unbounded, so a FormData field name with thousands of nested bracket segments causes excessive recursion, leading to a RangeError due to maximum call stack size exceeded. This vulnerability affects axios.formToJSON(), the default transformRequest when sending FormData as application/json, and the public formToJSON API. Axios does not currently enforce a maximum recursion depth in formDataToJSON, unlike its inverse serializer which has a maxDepth guard. The vulnerability primarily risks server-side applications processing untrusted FormData field names. Exploitation results in denial of service by crashing or rejecting requests before network I/O.

Potential Impact

Denial of service against applications that process untrusted FormData field names through axios' FormData-to-JSON conversion. Requests with deeply nested FormData keys cause a RangeError that can fail the request or terminate the process if unhandled. Normal FormData usage without JSON serialization is unaffected. The vulnerability does not allow code execution or data leakage but disrupts service availability.

Mitigation Recommendations

No official patch or fix is currently available. Applications should avoid converting attacker-controlled FormData to JSON using axios.formToJSON() or by sending FormData with Content-Type application/json. Validate and reject FormData field names with excessive nesting depth before conversion or sending. Avoid setting Content-Type to application/json for untrusted FormData to bypass the vulnerable code path. Catching the RangeError can prevent process termination but does not fix the underlying recursion issue and should not be relied on as the primary mitigation.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Gcve Source
db.gcve.eu
Osv Id
GHSA-42h9-826w-cgv3
Osv Schema Version
1.4.0
Aliases
[]
Ecosystems
["npm"]
Database Specific Severity
MODERATE
Cvss Version
4.0

Threat ID: 6a5e79ee2a4a8d59899bbfdd

Added to database: 07/20/2026, 19:41:34 UTC

Last enriched: 07/20/2026, 19:48:43 UTC

Last updated: 07/21/2026, 05:08:54 UTC

Views: 8

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses