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-2024-1874

CVE-2024-1874: PHP proc_open() RCE Vulnerability

CVE-2024-1874 is a remote code execution vulnerability in PHP's proc_open() function affecting Windows systems. Insufficient escaping allows attackers to execute arbitrary commands. This article covers technical details, affected versions, impact, and mitigation strategies.

Published: January 28, 2026

CVE-2024-1874 Overview

CVE-2024-1874 is a critical command injection vulnerability affecting PHP on Windows systems. The vulnerability exists in the proc_open() function when using array syntax for command arguments. Due to insufficient escaping of user-supplied input, attackers who control the arguments passed to an executed command can inject arbitrary commands that will be executed by the Windows shell.

This vulnerability impacts PHP versions 8.1.* before 8.1.28, 8.2.* before 8.2.18, and 8.3.* before 8.3.5, representing a significant attack surface for PHP-based web applications running on Windows servers.

Critical Impact

Attackers can achieve arbitrary command execution on Windows servers running vulnerable PHP versions, potentially leading to complete system compromise, data exfiltration, and lateral movement within affected networks.

Affected Products

  • PHP versions 8.1.0 through 8.1.27
  • PHP versions 8.2.0 through 8.2.17
  • PHP versions 8.3.0 through 8.3.4
  • Fedora 39 and Fedora 40 (bundled PHP packages)

Discovery Timeline

  • 2024-04-29 - CVE-2024-1874 published to NVD
  • 2025-11-04 - Last updated in NVD database

Technical Details for CVE-2024-1874

Vulnerability Analysis

The vulnerability resides in PHP's proc_open() function, which is commonly used to execute external programs and establish communication channels with them. When developers use the array syntax to pass command arguments (a practice recommended for security), PHP is expected to properly escape each argument to prevent shell metacharacter interpretation.

However, the escaping mechanism on Windows platforms contains a critical flaw. The Windows command shell (cmd.exe) interprets certain special characters differently than Unix shells, and PHP's argument escaping logic fails to account for all Windows-specific shell metacharacters and escape sequences.

This allows attackers who can control input that becomes part of command arguments to break out of the intended command context and inject additional commands. The network-accessible nature of most PHP applications combined with the lack of required privileges or user interaction makes this vulnerability particularly dangerous for internet-facing systems.

Root Cause

The root cause of CVE-2024-1874 is improper output encoding (CWE-116) in PHP's process execution layer. When constructing the command line string for Windows process creation, the argument escaping routine does not adequately neutralize shell metacharacters specific to the Windows command interpreter.

Key factors contributing to this vulnerability include:

  • Differences between Windows and Unix shell parsing semantics
  • Incomplete handling of Windows-specific escape sequences
  • Insufficient sanitization of characters that have special meaning in cmd.exe

Attack Vector

The attack vector for CVE-2024-1874 is network-based, requiring no authentication or user interaction. An attacker can exploit this vulnerability by:

  1. Identifying a PHP application that uses proc_open() with array syntax where user input influences command arguments
  2. Crafting malicious input containing Windows shell metacharacters
  3. Submitting this input through the application's normal interface (web forms, API calls, etc.)
  4. The malicious payload bypasses PHP's argument escaping and executes in the Windows shell context

The exploitation mechanism involves injecting shell operators and commands that the Windows command interpreter processes after the intended command execution. This can include command chaining operators, output redirection, and arbitrary command execution.

For detailed technical analysis of the exploitation mechanism, refer to the GitHub Security Advisory GHSA-pc52-254m-w9w7 and the CERT Vulnerability ID 123335.

Detection Methods for CVE-2024-1874

Indicators of Compromise

  • Unexpected child processes spawned from PHP worker processes (e.g., php-cgi.exe, php.exe)
  • Unusual command-line arguments in process execution logs containing shell metacharacters
  • Suspicious network connections initiated by PHP processes
  • Creation of unexpected files or registry modifications by web server user accounts

Detection Strategies

  • Deploy endpoint detection rules to monitor for anomalous process trees originating from PHP executables
  • Implement web application firewall (WAF) rules to detect shell metacharacter injection attempts in request parameters
  • Enable command-line auditing on Windows servers to capture process creation events with full argument logging
  • Review application logs for error messages indicating unexpected shell behavior or command failures

Monitoring Recommendations

  • Configure SIEM alerts for process creation events where PHP is the parent and child processes are command interpreters or system utilities
  • Monitor for outbound network connections from PHP processes to unexpected destinations
  • Track file system changes in web-accessible directories and system locations
  • Implement behavioral analysis to detect deviations from normal PHP application execution patterns

How to Mitigate CVE-2024-1874

Immediate Actions Required

  • Upgrade PHP to patched versions: 8.1.28+, 8.2.18+, or 8.3.5+
  • Audit PHP applications for usage of proc_open(), shell_exec(), exec(), and similar functions
  • Implement strict input validation and whitelist-based filtering for any user input used in command execution
  • Consider deploying compensating controls such as WAF rules while patching is completed

Patch Information

PHP has released security updates addressing this vulnerability across all affected version branches. Organizations should update to the following minimum versions:

  • PHP 8.1.28 or later for the 8.1.x branch
  • PHP 8.2.18 or later for the 8.2.x branch
  • PHP 8.3.5 or later for the 8.3.x branch

Patch details and source code changes are available in the PHP Security Advisory. Fedora users should apply updates through their package manager as documented in the Fedora Package Announcements.

Workarounds

  • Disable or restrict PHP functions that execute system commands using the disable_functions directive in php.ini
  • Implement application-level input sanitization that strictly validates and escapes user-controlled data before command execution
  • Use alternative approaches to shell command execution where possible, such as native PHP functions or libraries
  • Deploy network segmentation to limit the impact of potential compromises on Windows PHP servers
bash
# PHP configuration to disable dangerous functions
# Add to php.ini to restrict command execution capabilities
disable_functions = proc_open,shell_exec,exec,system,passthru,popen,proc_nice,proc_terminate

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechPhp

  • SeverityCRITICAL

  • CVSS Score9.4

  • EPSS Probability57.55%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityLow
  • CWE References
  • CWE-116
  • Technical References
  • Openwall OSS-Security Post

  • Openwall OSS-Security Update

  • Fedora Package Announcement

  • Fedora Package Announcement

  • NetApp Security Advisory NTAP-20240510-0009

  • Fedora Package Announcement

  • Fedora Package Announcement

  • CERT Vulnerability ID 123335

  • Vicarius Blog Post on Command Injection
  • Vendor Resources
  • GitHub Security Advisory GHSA-pc52-254m-w9w7
  • Related CVEs
  • CVE-2024-8926: PHP Command Injection RCE Vulnerability

  • CVE-2024-4577: PHP CGI on Windows RCE Vulnerability

  • CVE-2024-5585: PHP proc_open() RCE Vulnerability

  • CVE-2022-31626: PHP pdo_mysql Buffer Overflow RCE Flaw
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