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
    • 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-31859

CVE-2026-31859: Craft CMS Reflected XSS Vulnerability

CVE-2026-31859 is a reflected XSS flaw in Craft CMS that allows attackers to execute malicious JavaScript through unsanitized return URLs. This post explains its impact, affected versions, and mitigation steps.

Published: March 13, 2026

CVE-2026-31859 Overview

CVE-2026-31859 is a Cross-Site Scripting (XSS) vulnerability in Craft CMS, a popular content management system. The vulnerability exists due to an incomplete fix for CVE-2025-35939, where the strip_tags() function was introduced in src/web/User.php to sanitize return URLs before they are stored in the session. However, strip_tags() only removes HTML tags (angle brackets) and does not inspect or filter URL schemes. Malicious payloads using schemes like javascript: contain no HTML tags and pass through strip_tags() completely unmodified, enabling reflected XSS when the return URL is rendered in an href attribute.

Critical Impact

Attackers can execute arbitrary JavaScript in the context of authenticated user sessions, potentially stealing session cookies, performing actions on behalf of users, or redirecting users to malicious sites.

Affected Products

  • Craft CMS versions prior to 5.9.7
  • Craft CMS versions prior to 4.17.3
  • craftcms/cms package (Composer)

Discovery Timeline

  • 2026-03-11 - CVE-2026-31859 published to NVD
  • 2026-03-12 - Last updated in NVD database

Technical Details for CVE-2026-31859

Vulnerability Analysis

This vulnerability represents a classic case of incomplete input validation leading to reflected XSS. The original fix for CVE-2025-35939 attempted to sanitize user-controlled return URLs by using PHP's strip_tags() function. While this approach effectively removes HTML tags enclosed in angle brackets, it fails to address dangerous URL schemes.

The strip_tags() function is designed to remove HTML and PHP tags from a string, but URL schemes like javascript:, vbscript:, or data: do not contain angle brackets and are therefore not filtered. When the unsanitized return URL is later rendered in an href attribute within the application's HTML output, the malicious JavaScript payload executes in the victim's browser context.

This vulnerability is classified under CWE-79 (Improper Neutralization of Input During Web Page Generation), specifically as a reflected XSS attack vector. The attack requires user interaction—typically clicking a crafted link—but requires no authentication or special privileges from the attacker's perspective.

Root Cause

The root cause is the improper use of strip_tags() for URL sanitization in src/web/User.php. The function was implemented as a security measure but does not validate URL schemes. Proper mitigation requires either a URL scheme allowlist (permitting only http: and https:) or explicit blocking of dangerous schemes like javascript:, vbscript:, and data:.

Attack Vector

The attack is network-based and requires user interaction. An attacker crafts a malicious URL containing a javascript: payload in the return URL parameter. When a victim clicks the link, the payload is stored in their session and later rendered in an href attribute. Upon interacting with the affected element, the JavaScript executes in the victim's browser with full access to the session context.

A typical attack payload would use a format like javascript:alert(document.cookie) or more sophisticated payloads designed to exfiltrate session tokens or perform authenticated actions. Since the payload contains no HTML tags, it bypasses the strip_tags() sanitization entirely and is stored unchanged in the session.

Detection Methods for CVE-2026-31859

Indicators of Compromise

  • Unusual return URL parameters containing javascript:, vbscript:, or data: schemes in web server access logs
  • Session data containing URL values with script-based schemes
  • Reports of unexpected JavaScript execution or browser alerts from authenticated users
  • Referrer URLs in logs pointing to external domains with encoded payloads

Detection Strategies

  • Implement Web Application Firewall (WAF) rules to detect and block requests containing javascript: or similar dangerous URL schemes in parameter values
  • Enable Content Security Policy (CSP) headers to mitigate XSS impact by restricting inline script execution
  • Review web server logs for URL parameters containing suspicious scheme patterns using regex matching
  • Deploy client-side XSS detection tools that monitor for unexpected script execution

Monitoring Recommendations

  • Monitor application logs for return URL parameters containing non-HTTP schemes
  • Set up alerts for CSP violation reports that may indicate attempted XSS exploitation
  • Track user session anomalies that could suggest session hijacking following successful XSS attacks
  • Implement real-time log analysis for patterns associated with XSS payloads

How to Mitigate CVE-2026-31859

Immediate Actions Required

  • Upgrade Craft CMS to version 5.9.7 or later for the 5.x branch
  • Upgrade Craft CMS to version 4.17.3 or later for the 4.x branch
  • Review and update Composer dependencies using composer update craftcms/cms
  • Implement Content Security Policy headers to limit XSS impact as a defense-in-depth measure

Patch Information

The vulnerability is fixed in Craft CMS versions 5.9.7 and 4.17.3. The patch implements proper URL scheme validation to ensure only safe schemes (http: and https:) are permitted in return URLs. Users should update immediately via Composer. For detailed patch information, refer to the GitHub Security Advisory.

Workarounds

  • Implement a reverse proxy or WAF rule to strip or block requests containing javascript:, vbscript:, or data: schemes in URL parameters
  • Deploy Content Security Policy headers with script-src 'self' to prevent inline JavaScript execution
  • Temporarily disable functionality that relies on user-controlled return URLs if upgrading is not immediately possible
  • Monitor and filter session data for malicious URL schemes at the application layer
bash
# Example: Apache mod_rewrite rule to block javascript: URLs
RewriteEngine On
RewriteCond %{QUERY_STRING} javascript: [NC,OR]
RewriteCond %{QUERY_STRING} vbscript: [NC,OR]
RewriteCond %{QUERY_STRING} data: [NC]
RewriteRule .* - [F,L]

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

  • Vulnerability Details
  • TypeXSS

  • Vendor/TechCraftcms

  • SeverityMEDIUM

  • CVSS Score6.9

  • EPSS Probability0.05%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-79
  • Technical References
  • GitHub Security Advisory
  • Related CVEs
  • CVE-2026-29175: Craftcms Craft Commerce XSS Vulnerability

  • CVE-2026-29173: Craft Commerce Stored XSS Vulnerability

  • CVE-2026-29176: Craft Commerce Stored XSS Vulnerability

  • CVE-2026-29177: Craft Commerce Stored XSS 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