Skip to main content

Axios CVE-2026-42042

| EUVDEUVD-2026-25607 MEDIUM
Permissive List of Allowed Inputs (CWE-183)
2026-04-24 GitHub_M GHSA-xx6v-rp6x-q39c
5.4
CVSS 3.1 · GitHub Advisory
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Application vulnerable to prototype pollution
  2. Delivery
    Attacker injects truthy value into withXSRFToken property
  3. Exploit
    User loads poisoned JavaScript context
  4. Install
    User triggers Axios HTTP request
  5. C2
    Axios evaluates withXSRFToken as truthy, skips origin check
  6. Execute
    XSRF token transmitted to attacker-controlled cross-origin endpoint
  7. Impact
    Token exfiltrated, CSRF protection bypassed

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V2 - Validation and Business Logic Strict input allowlisting
Exploitation Conditions

Exploitation requires one of the following specific conditions: (1) The consuming application is vulnerable to prototype pollution, and the attacker can inject a truthy non-boolean value into Object.prototype.withXSRFToken or directly into the Axios config object's withXSRFToken property, OR (2) A developer explicitly misconfigures withXSRFToken with a non-boolean truthy value such as a string (e.g., config.withXSRFToken = 'true' or 'always') or a number, instead of the intended boolean true. Additionally, user interaction is required-the vulnerability only manifests when the user triggers an Axios-based HTTP request, such as submitting a form or clicking a link that initiates a network call. The attacker must also control a cross-origin server endpoint to receive the exfiltrated token. Default Axios configurations (withXSRFToken not explicitly set) are not directly vulnerable under normal circumstances; the vulnerability requires either misconfiguration or a chained prototype pollution vulnerability to activate.

Impact

This vulnerability presents moderate real-world risk despite a CVSS score of 5.4 (medium). The attack vector is network-based with low complexity and no required privilege escalation, but requires user interaction (UI:R), which limits widespread automated exploitation. The CVSS vector (AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N) indicates confidentiality and integrity impacts within the same scope-specifically token disclosure and potential request forgery. The practical exploitation path requires either: (1) a prototype pollution vulnerability in the consuming application to inject a truthy value into withXSRFToken, or (2) misconfiguration by developers who explicitly set withXSRFToken to a non-boolean truthy value. No public exploit code has been identified at the time of analysis, and CISA KEV status is not confirmed. The vulnerability's impact depends heavily on whether XSRF tokens contain sensitive information (e.g., session identifiers or long-lived secrets) that an attacker could exfiltrate to a cross-origin endpoint. Applications that rotate XSRF tokens frequently or use short-lived, single-use tokens experience reduced practical risk. The UI requirement (user must trigger the request) and reliance on misconfiguration or chaining with prototype pollution make this a secondary vulnerability rather than a primary attack vector. Organizations using Axios should prioritize patching only if they: (1) use custom withXSRFToken configuration, (2) are vulnerable to prototype pollution attacks, or (3) store long-lived sensitive data in XSRF tokens.

Exploit ScenarioDerived

An attacker identifies that a web application uses Axios and is vulnerable to prototype pollution via a user-controlled query parameter or form input. The attacker crafts a malicious request containing prototype pollution payload that sets Object.prototype.withXSRFToken to 'bypass' (a truthy non-boolean string). When a legitimate user visits the application, their browser loads the poisoned JavaScript context. When the user triggers any Axios HTTP request (e.g., submitting a form or clicking a button), Axios checks the withXSRFToken property. Due to the truthy/falsy evaluation, it sees 'bypass' as truthy, skips the same-origin check, and appends the XSRF token from the cookie to the request. The attacker has set up a cross-origin endpoint under their control as the request target, and the token is transmitted in plaintext to the attacker's server, compromising the user's CSRF protection.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Apr 24, 2026

Axios HTTP client versions prior to 1.15.1 and 0.31.1 use loose truthy/falsy comparison instead of strict boolean checks for the withXSRFToken config property, allowing XSRF tokens to be sent to cross-origin servers when the property is set to any truthy non-boolean value through prototype pollution or misconfiguration. This bypasses same-origin validation and enables attackers to exfiltrate XSRF tokens to attacker-controlled domains, compromising CSRF protection across applications using vulnerable versions.

RemediationAI

Upgrade Axios to version 1.15.1 or later for the 1.x branch, or 0.31.1 or later for the 0.x branch. These versions implement strict boolean comparison (if (config.withXSRFToken === true)) instead of truthy/falsy evaluation. Refer to the official GitHub Security Advisory at https://github.com/axios/axios/security/advisories/GHSA-xx6v-rp6x-q39c for detailed patching instructions. If immediate patching is not feasible, implement the following compensating controls: (1) Audit and lock your application's Axios configuration to ensure withXSRFToken is never set to non-boolean values-enforce this via configuration validation at application startup to catch misconfigurations early; (2) Disable or implement strict controls on prototype pollution attack surfaces by using Object.freeze() on configuration objects, Object.preventExtensions() on prototype chains, or adopting a library like deepfreeze for immutable config; (3) Implement Content Security Policy (CSP) headers with strict-dynamic and nonce-based script whitelisting to prevent unauthorized XSS-based prototype pollution attacks that could inject values into the Axios config; (4) Monitor HTTP request headers in your application logs for unexpected XSRF token presence in cross-origin requests and alert on anomalies. Note that workaround (2) introduces performance overhead and may conflict with legitimate dynamic configuration patterns, and workaround (3) requires browser support and careful rollout to avoid breaking legitimate functionality.

Affected VersionsENISA

axios < 0.31.1
axios 1.0.0, < 1.15.1

Affected Packages

npm axios fix: 0.31.1, 1.15.1

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in npm

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Axios implements XSRF (Cross-Site Request Forgery) token protection by validating that requests are same-origin before attaching XSRF tokens from cookies or custom headers. The vulnerability stems from CWE-183 (Permissive List of Allowed Inputs), where the withXSRFToken property evaluation uses JavaScript's truthy/falsy semantics (if (config.withXSRFToken)) instead of strict boolean comparison (if (config.withXSRFToken === true)). This allows any truthy value-including non-boolean values like strings, objects, or numbers-to pass the check. When withXSRFToken evaluates as truthy, the isURLSameOrigin check is bypassed entirely, causing tokens to be appended to all requests regardless of origin. The vulnerability affects both browser and Node.js environments where Axios is used (CPE: cpe:2.3:a:axios:axios:*:*:*:*:*:*:*:*). Prototype pollution attacks or direct misconfigurations can inject truthy values into this property.

Know when Axios gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

GitHub Advisory PRIMARY 5.4 MEDIUM
AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
Red Hat 6.1 MEDIUM

Primary rating from GitHub Advisory.

CVSS VectorGitHub Advisory

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
None

Lifecycle Timeline

3
Patch released
Apr 27, 2026 - 20:05 nvd
Patch available
Patch available
Apr 24, 2026 - 20:17 EUVD
CVE Published
Apr 24, 2026 - 18:03 nvd
MEDIUM 5.4

DescriptionGitHub Advisory

Axios is a promise based HTTP client for the browser and Node.js. Prior to 1.15.1 and 0.31.1, 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. This vulnerability is fixed in 1.15.1 and 0.31.1.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 273 npm packages depend on axios (189 direct, 84 indirect)

Ecosystem-wide dependent count for version 1.0.0.

Threat Intelligence Overview

EPSS Score
0.0%
Top 92% exploitable
Threat Intel
1
1 source
Exploit
POC
Public exploit code exists
Data Quality
6 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC Yes
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
No
Human Impact· derived
Medium
Technical Impact
Partial

Priority Score

47
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +27
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

More in Axios

View all
CVE-2026-42043 CRITICAL POC
10.0 Apr 24

NO_PROXY protection bypass in Axios HTTP client (versions 1.0.0-1.15.0 and ≤0.31.0) lets an attacker who controls a requ

CVE-2026-42044 CRITICAL POC
9.1 Apr 24

JSON response tampering in the Axios HTTP client (versions 1.0.0 up to but not including 1.15.2) lets an attacker who ca

CVE-2026-67320 HIGH POC
8.3 Aug 01

Prototype pollution via the Node.js HTTP adapter in axios allows an attacker who controls `Object.prototype.proxy` to si

CVE-2025-27152 HIGH POC
7.7 Mar 07

axios is a promise based HTTP client for the browser and node.js. Rated high severity (CVSS 7.7), this vulnerability is

CVE-2025-58754 HIGH POC
7.5 Sep 12

Axios is a promise based HTTP client for the browser and Node.js. Rated high severity (CVSS 7.5), this vulnerability is

CVE-2026-25639 HIGH POC
7.5 Feb 09

Axios versions up to 0.30.3 is affected by improper check for unusual or exceptional conditions (CVSS 7.5).

CVE-2024-39338 HIGH POC
7.5 Aug 12

axios 1.7.2 allows SSRF via unexpected behavior where requests for path relative URLs get processed as protocol relative

CVE-2021-3749 HIGH POC
7.5 Aug 31

axios is vulnerable to Inefficient Regular Expression Complexity. Rated high severity (CVSS 7.5), this vulnerability is

CVE-2019-10742 HIGH POC
7.5 May 07

Axios up to and including 0.18.0 allows attackers to cause a denial of service (application crash) by continuing to acce

CVE-2026-42033 HIGH POC
7.4 Apr 24

Prototype pollution in Axios HTTP client versions before 1.15.1 and 0.31.1 enables silent interception and modification

CVE-2026-42039 MEDIUM POC
6.9 Apr 24

Denial of service in Axios HTTP client before versions 1.15.1 and 0.31.1 allows remote unauthenticated attackers to cras

CVE-2026-42041 MEDIUM POC
6.5 Apr 24

Prototype pollution in Axios library versions prior to 1.15.1 and 0.31.1 allows remote attackers to suppress HTTP error

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy