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
    • 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-2025-35939

CVE-2025-35939: Craft CMS RCE Vulnerability

CVE-2025-35939 is a remote code execution vulnerability in Craft CMS where unauthenticated users can inject arbitrary PHP code into session files. This article covers the technical details, affected versions, and patches.

Updated: January 22, 2026

CVE-2025-35939 Overview

CVE-2025-35939 is a session file content injection vulnerability in Craft CMS that allows unauthenticated users to store arbitrary content in server-side session files. The vulnerability stems from improper input sanitization when Craft CMS handles authentication redirects, enabling attackers to inject potentially malicious content—including PHP code—into predictable file locations on the server.

When Craft CMS receives requests requiring authentication, it redirects users to the login page while generating a session file at /var/lib/php/sessions. These session files follow a predictable naming convention (sess_[session_value]), where the session value is provided to the client via a Set-Cookie response header. Critically, Craft CMS stores the return URL without sanitizing parameters, allowing unauthenticated attackers to inject arbitrary values into known file locations.

Critical Impact

This vulnerability is listed in CISA's Known Exploited Vulnerabilities (KEV) catalog, indicating active exploitation in the wild. When combined with an independent vulnerability such as a Local File Inclusion (LFI), attackers could potentially achieve remote code execution by having the server execute the injected PHP code stored in session files.

Affected Products

  • Craft CMS versions prior to 5.7.5
  • Craft CMS versions prior to 4.15.3
  • craftcms craft_cms (all vulnerable versions)

Discovery Timeline

  • May 7, 2025 - CVE-2025-35939 published to NVD
  • October 24, 2025 - Last updated in NVD database

Technical Details for CVE-2025-35939

Vulnerability Analysis

This vulnerability represents a classic case of improper input validation (CWE-472) where user-controlled input is stored server-side without adequate sanitization. The attack exploits the session management mechanism in Craft CMS, specifically how the application handles return URLs during authentication workflows.

The core issue lies in the trust placed on user-supplied URL parameters during the redirect process. When an unauthenticated user attempts to access a protected resource, Craft CMS stores the requested URL in the session file to redirect the user back after successful authentication. However, the absence of proper sanitization means that attackers can craft malicious requests containing arbitrary content, including PHP code snippets, which are then written verbatim to the session file.

This vulnerability alone enables arbitrary content injection but requires a secondary vulnerability (such as LFI) to achieve code execution. The predictable nature of session file paths (/var/lib/php/sessions/sess_[session_value]) combined with attacker-controlled session values creates a reliable primitive for storing malicious payloads at known locations.

Root Cause

The root cause is the lack of input sanitization when storing return URLs in PHP session files. Craft CMS directly writes the client-supplied return URL parameter to the session file without filtering or encoding potentially dangerous content. This violates the security principle of never trusting user input, especially when that input is persisted to server-side storage.

The vulnerability is classified under CWE-472 (External Control of Assumed-Immutable Web Parameter), as the application assumes the return URL parameter will contain only valid URL data, when in reality an attacker can supply arbitrary content including executable code.

Attack Vector

The attack is network-accessible and requires no authentication or user interaction. An attacker can exploit this vulnerability by:

  1. Sending an HTTP request to a protected Craft CMS endpoint
  2. Including malicious PHP code within the URL parameters
  3. Receiving a session cookie with a predictable session identifier
  4. The malicious content is written to /var/lib/php/sessions/sess_[session_value]
  5. If a secondary vulnerability exists (e.g., LFI), the attacker can include the session file and execute the injected code

The attack leverages standard HTTP mechanisms and requires only the ability to send crafted HTTP requests to the target server. The vulnerability's inclusion in the CISA KEV catalog indicates that threat actors are actively exploiting this technique in real-world attacks.

Detection Methods for CVE-2025-35939

Indicators of Compromise

  • Unusual content patterns in PHP session files located at /var/lib/php/sessions/
  • Session files containing PHP code markers such as <?php, <?=, or encoded PHP payloads
  • Abnormally large session files or files with non-standard serialized data
  • HTTP requests to protected endpoints with suspicious URL parameters containing code-like patterns

Detection Strategies

  • Monitor web application logs for requests with unusual URL parameter content, particularly those containing PHP syntax or encoded payloads
  • Implement file integrity monitoring on the PHP sessions directory to detect suspicious content patterns
  • Deploy Web Application Firewall (WAF) rules to detect and block requests containing PHP code patterns in URL parameters
  • Use behavioral analysis to identify anomalous session creation patterns or rapid session generation from single sources

Monitoring Recommendations

  • Configure alerts for any PHP session files containing executable code patterns or abnormal content
  • Monitor for increased error rates related to session handling or file inclusion attempts
  • Track authentication redirect patterns for anomalies indicating exploitation attempts
  • Review server access logs for requests targeting protected endpoints with oversized or malformed URL parameters

How to Mitigate CVE-2025-35939

Immediate Actions Required

  • Upgrade Craft CMS 5.x installations to version 5.7.5 or later immediately
  • Upgrade Craft CMS 4.x installations to version 4.15.3 or later immediately
  • Review and purge existing PHP session files for any suspicious content
  • Implement additional server-side input validation as a defense-in-depth measure
  • Consider blocking public access to the CMS admin panel until patching is complete

Patch Information

CraftCMS has released patched versions addressing this vulnerability. The fix is available in:

  • Craft CMS 5.7.5 (GitHub Release 5.7.5)
  • Craft CMS 4.15.3 (GitHub Release 4.15.3)

The GitHub Pull Request #17220 contains the technical details of the fix, which implements proper sanitization of return URL parameters before storing them in session files.

Organizations should prioritize this patch given the vulnerability's presence in the CISA Known Exploited Vulnerabilities catalog.

Workarounds

  • Implement WAF rules to sanitize or block requests containing PHP code patterns in URL parameters
  • Configure PHP to use an alternative session storage mechanism (e.g., database or Redis) that is not directly accessible via file inclusion
  • Restrict file system permissions on the PHP sessions directory to prevent web server processes from including files from that location
  • Deploy network-level controls to limit access to the Craft CMS application while awaiting patching
bash
# Example: Configure restrictive permissions on PHP sessions directory
chmod 700 /var/lib/php/sessions
chown www-data:www-data /var/lib/php/sessions

# Example: WAF rule pattern to detect PHP code in URL parameters (ModSecurity format)
# SecRule ARGS "@rx <\?php|<\?=" "id:100001,phase:1,deny,status:403,msg:'Potential PHP injection attempt'"

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechCraft Cms

  • SeverityMEDIUM

  • CVSS Score6.9

  • EPSS Probability16.71%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/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
  • CISA KEV Information
  • In CISA KEVYes
  • CWE References
  • CWE-472

  • NVD-CWE-Other
  • Technical References
  • GitHub Release 4.15.3

  • GitHub Release 5.7.5

  • CSAF White Paper VA-25-147-01

  • CVE-2025-35939 Record

  • CISA Known Exploit Catalog
  • Vendor Resources
  • GitHub Pull Request
  • Related CVEs
  • CVE-2026-33157: Craftcms Craft CMS RCE Vulnerability

  • CVE-2026-32264: Craft CMS Behavior Injection RCE Vulnerability

  • CVE-2026-32261: Webhooks for Craft CMS RCE Vulnerability

  • CVE-2026-31857: Craft CMS RCE 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