Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. axios
  4. ›
  5. GHSA-hcpx-6fm6-wx23

GHSA-hcpx-6fm6-wx23: Axios form serializer maxDepth bypass via {} metatoken

July 20, 2026

Axios versions in the fixed lines for GHSA-62hf-57xw-28j9 still contain an incomplete depth-limit bypass in lib/helpers/toFormData.js. When serializing an object with a top-level key ending in {}, axios calls JSON.stringify() on that value before the formSerializer.maxDepth guard can inspect the nested structure.

An attacker who can control object keys and nested values passed by an application into axios form or parameter serialization can trigger a raw RangeError: Maximum call stack size exceeded, causing a denial of service in the affected request path.

The maxDepth=100 guard added in axios 1.15.0 to fix GHSA-62hf-57xw-28j9 lives inside the build() recursion in lib/helpers/toFormData.js. The default visitor at lib/helpers/toFormData.js:166-170 still has a top-level shortcut that calls JSON.stringify(value) whenever a key ends in '{}', before build() ever sees the nested value. JSON.stringify on a deeply nested object stack-overflows with RangeError: Maximum call stack size exceeded, which propagates synchronously out of the axios call. The exact attacker-data flow that the original advisory described (proxy-style code that forwards client JSON into axios({ data, params })) still crashes the process at depth ~3000 on a default Node.js stack, despite v1.16.0 being patched.

References

  • github.com/advisories/GHSA-hcpx-6fm6-wx23
  • 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-hcpx-6fm6-wx23

Code Behaviors & Features

Detect and mitigate GHSA-hcpx-6fm6-wx23 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.31.1 before 0.33.0, all versions starting from 1.15.1 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-674: Uncontrolled Recursion

Source file

npm/axios/GHSA-hcpx-6fm6-wx23.yml

Spotted a mistake? Edit the file on GitLab.

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

Page generated Sat, 08 Aug 2026 00:16:43 +0000.