Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. axios
  4. ›
  5. CVE-2026-42042

CVE-2026-42042: Axios: XSRF Token Cross-Origin Leakage via Prototype Pollution Gadget in `withXSRFToken` Boolean Coercion

May 5, 2026

The Axios library’s XSRF token protection logic uses JavaScript truthy/falsy semantics instead of strict boolean comparison for the withXSRFToken config property. When this property is set to any truthy non-boolean value (via prototype pollution or misconfiguration), the same-origin check (isURLSameOrigin) is short-circuited, causing XSRF tokens to be sent to all request targets including cross-origin servers controlled by an attacker.

Severity: Medium (CVSS 5.4) Affected Versions: All versions since withXSRFToken was introduced Vulnerable Component: lib/helpers/resolveConfig.js:59 Environment: Browser-only (XSRF logic only runs when hasStandardBrowserEnv is true)

References

  • github.com/advisories/GHSA-xx6v-rp6x-q39c
  • github.com/axios/axios/security/advisories/GHSA-xx6v-rp6x-q39c
  • nvd.nist.gov/vuln/detail/CVE-2026-42042

Code Behaviors & Features

Detect and mitigate CVE-2026-42042 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →

Affected versions

All versions before 0.31.1, all versions starting from 1.0.0 before 1.15.1

Fixed versions

  • 0.31.1
  • 1.15.1

Solution

Upgrade to versions 0.31.1, 1.15.1 or above.

Impact 5.4 MEDIUM

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

Learn more about CVSS

Weakness

  • CWE-183: Permissive List of Allowed Inputs
  • CWE-201: Insertion of Sensitive Information Into Sent Data

Source file

npm/axios/CVE-2026-42042.yml

Spotted a mistake? Edit the file on GitLab.

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

Page generated Sun, 08 Nov 2026 00:16:26 +0000.