Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. axios
  4. ›
  5. GHSA-pmv8-rq9r-6j72

GHSA-pmv8-rq9r-6j72: Axios: Deep formToJSON Key Recursion Can Cause Denial of Service

July 20, 2026

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.

An uncontrolled recursion vulnerability in formDataToJSON allows any user who controls FormData input to crash a Node.js process with a single request. The function recurses once per bracket-delimited segment in a FormData key name with no depth limit, so a key like a[x][x][x]... with 15,000+ segments exhausts the call stack. This is a denial-of-service that kills the process via an unrecoverable RangeError. The inverse function toFormData already enforces a maxDepth limit (default 100) for exactly this reason — formDataToJSON lacks the equivalent guard.

References

  • github.com/advisories/GHSA-pmv8-rq9r-6j72
  • github.com/axios/axios/commit/1417285c69344bbcc6420a021f67dee0c6fedb2d
  • github.com/axios/axios/commit/32fc489632377d214db55bfa4e2c48486a7d7ce2
  • github.com/axios/axios/pull/11000
  • github.com/axios/axios/pull/11001
  • github.com/axios/axios/releases/tag/v0.33.0
  • github.com/axios/axios/releases/tag/v1.18.0
  • github.com/axios/axios/security/advisories/GHSA-pmv8-rq9r-6j72

Code Behaviors & Features

Detect and mitigate GHSA-pmv8-rq9r-6j72 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 0.28.0 before 0.33.0, all versions starting from 1.0.0 before 1.18.0

Fixed versions

  • 0.33.0
  • 1.18.0

Solution

Upgrade to versions 0.33.0, 1.18.0 or above.

Impact 5.3 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

Learn more about CVSS

Weakness

  • CWE-400: Uncontrolled Resource Consumption
  • CWE-770: Allocation of Resources Without Limits or Throttling

Source file

npm/axios/GHSA-pmv8-rq9r-6j72.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sat, 08 Aug 2026 00:18:25 +0000.