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-5585

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

CVE-2024-5585 is a remote code execution flaw in PHP's proc_open() function affecting Windows systems. Attackers can execute arbitrary commands through insufficient escaping. This article covers technical details, affected versions, impact, and mitigation strategies.

Published: January 28, 2026

CVE-2024-5585 Overview

CVE-2024-5585 is a command injection vulnerability affecting PHP versions 8.1.* before 8.1.29, 8.2.* before 8.2.20, and 8.3.* before 8.3.8. This vulnerability represents an incomplete fix for the previously disclosed CVE-2024-1874. When using the proc_open() command with array syntax on Windows systems, insufficient escaping allows attackers to execute arbitrary commands in the Windows shell if they can control the arguments of the executed command. The bypass occurs when the command name includes trailing spaces, rendering the original CVE-2024-1874 fix ineffective.

Critical Impact

Attackers with control over command arguments can achieve arbitrary command execution on Windows-based PHP servers, potentially leading to complete system compromise, data exfiltration, and lateral movement within affected networks.

Affected Products

  • PHP versions 8.1.* before 8.1.29
  • PHP versions 8.2.* before 8.2.20
  • PHP versions 8.3.* before 8.3.8
  • Fedora 40 (via packaged PHP)

Discovery Timeline

  • 2024-06-09 - CVE-2024-5585 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2024-5585

Vulnerability Analysis

This vulnerability stems from an incomplete remediation of CVE-2024-1874, which addressed command injection issues in PHP's proc_open() function on Windows platforms. The original fix implemented argument escaping to prevent malicious input from breaking out of the intended command context. However, researchers discovered that including trailing spaces in the command name bypasses these protections entirely.

When proc_open() is called with array syntax, the function constructs a command string that gets passed to the Windows shell for execution. The escaping mechanism fails to account for edge cases where command names contain trailing whitespace characters. This oversight allows attackers who control command arguments to inject shell metacharacters and execute arbitrary commands with the privileges of the PHP process.

The vulnerability is particularly dangerous in web application contexts where user input may influence command execution parameters, such as file processing utilities, image manipulation tools, or system administration interfaces built with PHP.

Root Cause

The root cause lies in insufficient input sanitization within PHP's command execution handling for Windows environments. The escaping routine implemented to fix CVE-2024-1874 does not properly normalize command names before applying security controls. When a command name ends with trailing spaces, the escaping logic fails to properly isolate the command arguments, allowing shell metacharacters to be interpreted by the Windows command processor rather than being treated as literal string content.

Attack Vector

The attack requires network access to a vulnerable PHP application running on Windows where an attacker can influence arguments passed to proc_open() with array syntax. The attacker crafts malicious input containing shell metacharacters that exploit the trailing space bypass. When the PHP application processes this input through proc_open(), the injected commands execute in the Windows shell context.

For exploitation to succeed, the following conditions must be met:

  1. The target system runs a vulnerable PHP version on Windows
  2. The application uses proc_open() with array syntax
  3. User-controlled input influences the command arguments
  4. The command name or execution context allows trailing spaces

The attacker does not require authentication beyond what the target application mandates, making this vulnerability exploitable against any exposed PHP application meeting these criteria.

Detection Methods for CVE-2024-5585

Indicators of Compromise

  • Unusual proc_open() calls with trailing spaces in command names appearing in PHP error logs or application logs
  • Unexpected child processes spawned by PHP worker processes, particularly command shells (cmd.exe, powershell.exe)
  • Anomalous outbound network connections originating from PHP processes
  • Evidence of command execution artifacts such as new scheduled tasks, user accounts, or persistence mechanisms

Detection Strategies

  • Implement application-level logging for all proc_open(), exec(), and related command execution functions to capture argument patterns
  • Deploy endpoint detection rules to monitor for PHP processes spawning unusual child processes on Windows systems
  • Use web application firewall (WAF) rules to detect and block requests containing shell metacharacters in parameters likely to reach command execution functions
  • Conduct code audits to identify all instances of proc_open() usage with array syntax and assess input validation controls

Monitoring Recommendations

  • Monitor PHP process behavior for command shell invocations using process creation telemetry
  • Enable and review PHP error logs for warnings related to command execution functions
  • Implement file integrity monitoring on critical system directories to detect unauthorized modifications
  • Track network connections from web server processes to identify potential data exfiltration or command-and-control activity

How to Mitigate CVE-2024-5585

Immediate Actions Required

  • Upgrade PHP immediately to version 8.1.29, 8.2.20, or 8.3.8 or later depending on your installed branch
  • Audit all PHP applications for usage of proc_open() with array syntax and implement strict input validation
  • Apply the principle of least privilege to PHP processes, limiting their ability to execute system commands
  • Consider temporary removal or disabling of functionality that relies on proc_open() until patches are applied

Patch Information

PHP has released security updates addressing this vulnerability. Organizations should upgrade to the following patched versions:

  • PHP 8.1.29 or later for the 8.1.x branch
  • PHP 8.2.20 or later for the 8.2.x branch
  • PHP 8.3.8 or later for the 8.3.x branch

Fedora users should apply updates through their package manager. Additional details are available in the GitHub Security Advisory, Fedora Package Announcements, and the NetApp Security Advisory.

Workarounds

  • Implement strict allowlisting of permitted command names and arguments rather than relying on blocklisting
  • Normalize all command strings by trimming whitespace before execution
  • Use parameterized command execution methods that separate command names from arguments at the API level
  • Deploy application-layer controls to validate and sanitize all user input before it reaches command execution functions
  • Consider using PHP's escapeshellarg() and escapeshellcmd() functions as an additional defense layer, though these should not be the sole protection
bash
# Example: Verify PHP version and check for vulnerability
php -v
# Ensure version is 8.1.29+, 8.2.20+, or 8.3.8+

# Update PHP on Fedora systems
sudo dnf update php

# Verify the update
php -v

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechPhp

  • SeverityHIGH

  • CVSS Score8.8

  • EPSS Probability0.90%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-78

  • CWE-116
  • Technical References
  • Openwall Security Mailing List

  • GitHub Security Advisory

  • Fedora Package Announcement

  • Fedora Package Announcement

  • NetApp Security Advisory

  • Vicarius Blog Post on CVE-2024-1874
  • Related CVEs
  • CVE-2024-1874: PHP proc_open() RCE Vulnerability

  • CVE-2024-8926: PHP Command Injection RCE Vulnerability

  • CVE-2024-4577: PHP CGI on Windows 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