The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2026-42042

CVE-2026-42042: Axios HTTP Client CSRF Vulnerability

CVE-2026-42042 is a CSRF vulnerability in Axios HTTP client that bypasses XSRF token protection, allowing attackers to receive tokens via cross-origin requests. This article covers technical details, affected versions, and mitigations.

Published: April 30, 2026

CVE-2026-42042 Overview

Axios, a widely-used promise-based HTTP client for both browser and Node.js environments, contains a vulnerability in its XSRF (Cross-Site Request Forgery) token protection mechanism. Prior to versions 1.15.1 and 0.31.1, the 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.

Critical Impact

Attackers can exploit this vulnerability to intercept XSRF tokens intended for same-origin requests, potentially enabling cross-site request forgery attacks against applications using affected Axios versions.

Affected Products

  • Axios versions prior to 1.15.1
  • Axios versions prior to 0.31.1
  • Applications using Axios in Node.js environments

Discovery Timeline

  • 2026-04-24 - CVE CVE-2026-42042 published to NVD
  • 2026-04-27 - Last updated in NVD database

Technical Details for CVE-2026-42042

Vulnerability Analysis

This vulnerability stems from improper input validation in the Axios library's XSRF token handling logic. The core issue lies in how the withXSRFToken configuration property is evaluated. JavaScript's truthy/falsy evaluation model treats any non-falsy value (including non-boolean truthy values like non-empty strings, objects, or numbers) as logically true.

When an application or attacker (via prototype pollution) sets withXSRFToken to a truthy non-boolean value, the library incorrectly bypasses its built-in same-origin validation check performed by the isURLSameOrigin function. This bypass results in XSRF tokens being attached to HTTP requests destined for cross-origin servers, potentially exposing sensitive authentication tokens to malicious third-party endpoints.

The vulnerability is particularly concerning in scenarios where prototype pollution is achievable, as attackers could inject the malicious withXSRFToken property into the configuration object prototype, affecting all subsequent Axios requests made by the application.

Root Cause

The root cause is the use of JavaScript truthy evaluation (if (withXSRFToken)) rather than strict boolean comparison (if (withXSRFToken === true)) when determining whether to apply XSRF token protection logic. This permissive type coercion allows non-boolean truthy values to trigger unexpected code paths that skip the same-origin security check.

Attack Vector

The vulnerability is exploitable via network-based attacks that require user interaction. An attacker can leverage this flaw through two primary attack vectors:

  1. Prototype Pollution: If the target application has a separate prototype pollution vulnerability, an attacker can inject a truthy value for withXSRFToken into the Object prototype, causing all Axios instances to leak XSRF tokens to arbitrary endpoints.

  2. Misconfiguration Exploitation: Applications that inadvertently set withXSRFToken to truthy non-boolean values (such as strings or configuration objects) will unintentionally expose XSRF tokens in cross-origin requests.

The attack results in XSRF tokens being sent to attacker-controlled servers, which can then be used to forge authenticated requests against the victim application.

Detection Methods for CVE-2026-42042

Indicators of Compromise

  • Unexpected outbound HTTP requests containing XSRF tokens to external domains
  • Axios configuration objects with non-boolean truthy values for withXSRFToken
  • Evidence of prototype pollution attacks modifying Object.prototype with XSRF-related properties
  • Network traffic showing authentication headers being sent to unrecognized third-party servers

Detection Strategies

  • Audit application code for Axios configurations where withXSRFToken is set to non-boolean values
  • Implement Content Security Policy (CSP) headers to monitor and restrict cross-origin requests
  • Review network logs for XSRF tokens appearing in requests to unexpected destinations
  • Use static analysis tools to detect improper type handling in security-sensitive configuration properties

Monitoring Recommendations

  • Monitor outbound HTTP traffic for authentication tokens being sent to untrusted domains
  • Implement runtime checks for prototype pollution attempts targeting configuration objects
  • Set up alerts for unusual cross-origin request patterns from client-side applications
  • Review dependency management systems for vulnerable Axios versions in production deployments

How to Mitigate CVE-2026-42042

Immediate Actions Required

  • Upgrade Axios to version 1.15.1 or later (for 1.x branch)
  • Upgrade Axios to version 0.31.1 or later (for 0.x branch)
  • Audit existing Axios configurations to ensure withXSRFToken is set to explicit boolean values only
  • Implement prototype pollution protections such as Object.freeze() on critical configuration objects

Patch Information

The vulnerability has been addressed in Axios versions 1.15.1 and 0.31.1. The fix implements strict boolean comparison for the withXSRFToken configuration property, ensuring that only explicit true values trigger the XSRF token attachment logic. For detailed information about the security fix, refer to the GitHub Security Advisory.

Workarounds

  • Explicitly set withXSRFToken: true or withXSRFToken: false using boolean literals in all Axios configurations
  • Implement a wrapper function that validates and sanitizes Axios configuration objects before use
  • Use Object.freeze() on Axios default configuration to prevent prototype pollution attacks
  • Implement server-side validation to reject XSRF tokens from unexpected origins
bash
# Update Axios to patched version
npm update axios@1.15.1

# Or for 0.x branch
npm update axios@0.31.1

# Verify installed version
npm list axios

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeCSRF

  • Vendor/TechAxios

  • SeverityMEDIUM

  • CVSS Score5.4

  • EPSS Probability0.03%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityLow
  • AvailabilityNone
  • CWE References
  • CWE-183
  • Vendor Resources
  • GitHub Security Advisory
  • Related CVEs
  • CVE-2026-42040: Axios Null Byte Encoding Vulnerability

  • CVE-2026-42041: Axios Auth Bypass Vulnerability

  • CVE-2026-42043: Axios HTTP Client SSRF Vulnerability

  • CVE-2026-42044: Axios Privilege Escalation Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English