Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2024-1874: CWE-116 Improper Encoding or Escaping of Output in PHP Group PHP

0
Critical
VulnerabilityCVE-2024-1874cvecve-2024-1874cwe-116
Published: Mon Apr 29 2024 (04/29/2024, 03:57:35 UTC)
Source: CVE Database V5
Vendor/Project: PHP Group
Product: PHP

Description

In PHP versions 8.1.* before 8.1.28, 8.2.* before 8.2.18, 8.3.* before 8.3.5, when using proc_open() command with array syntax, due to insufficient escaping, if the arguments of the executed command are controlled by a malicious user, the user can supply arguments that would execute arbitrary commands in Windows shell.

AI-Powered Analysis

AILast updated: 11/04/2025, 18:12:41 UTC

Technical Analysis

CVE-2024-1874 is a critical vulnerability affecting PHP versions 8.1.* prior to 8.1.28, 8.2.* prior to 8.2.18, and 8.3.* prior to 8.3.5. The flaw resides in the proc_open() function when invoked with array syntax on Windows platforms. proc_open() is used to execute external commands and manage process input/output streams. Due to insufficient escaping of command arguments, if an attacker can control these arguments, they can inject and execute arbitrary commands in the Windows shell environment. This vulnerability is classified under CWE-116, which involves improper encoding or escaping of output, leading to command injection. The vulnerability does not require any privileges or user interaction, making it remotely exploitable over the network if the PHP application exposes such functionality. The CVSS v3.1 score of 9.4 reflects the critical nature, with network attack vector, low complexity, no privileges required, and high impact on confidentiality and integrity. Although no exploits are publicly known yet, the ease of exploitation and severity make this a high-risk issue. The vulnerability primarily affects Windows-based PHP deployments, which are common in some enterprise environments. The lack of patch links suggests that fixes are either newly released or pending, so organizations must monitor official PHP releases closely. This vulnerability can lead to full system compromise, data theft, or further lateral movement within affected networks.

Potential Impact

For European organizations, the impact of CVE-2024-1874 can be severe, particularly for those running PHP-based web applications on Windows servers. Successful exploitation allows attackers to execute arbitrary commands remotely, potentially leading to full system compromise, data breaches, and disruption of services. This can affect confidentiality by exposing sensitive data, integrity by allowing unauthorized changes, and availability by enabling denial-of-service conditions. Organizations in sectors such as finance, healthcare, government, and critical infrastructure are especially at risk due to the sensitive nature of their data and regulatory requirements like GDPR. The vulnerability's ease of exploitation and lack of authentication requirements increase the likelihood of targeted attacks or automated scanning and exploitation attempts. Additionally, compromised systems could be used as footholds for broader attacks within European networks, amplifying the threat. The absence of known exploits in the wild currently provides a window for proactive mitigation, but the critical severity demands urgent attention.

Mitigation Recommendations

1. Immediately upgrade PHP installations to versions 8.1.28, 8.2.18, or 8.3.5 or later where the vulnerability is patched. 2. If immediate patching is not possible, restrict usage of proc_open() with array syntax on Windows systems, especially where user input controls command arguments. 3. Implement strict input validation and sanitization on all user-supplied data that might be passed to system commands, employing whitelisting approaches where feasible. 4. Employ application-layer firewalls or web application firewalls (WAFs) to detect and block suspicious command injection patterns targeting proc_open() usage. 5. Monitor logs for unusual command execution attempts or anomalies in PHP process spawning. 6. Limit PHP execution privileges and isolate PHP applications in containers or sandboxes to reduce impact scope. 7. Conduct security audits and code reviews focusing on usage of proc_open() and other system command invocations. 8. Educate developers about secure coding practices related to command execution and escaping on Windows platforms. 9. Maintain up-to-date backups and incident response plans to quickly recover from potential compromises.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.2
Assigner Short Name
php
Date Reserved
2024-02-25T04:39:00.479Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 690a3b61ff58c9332ff09425

Added to database: 11/4/2025, 5:44:01 PM

Last enriched: 11/4/2025, 6:12:41 PM

Last updated: 11/5/2025, 4:00:48 AM

Views: 4

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats