---
title: "CVE-2024-4577"
canonical: "https://kb.cynergy.app/space/MD/1134854154/CVE-2024-4577"
format: markdown
---
To address the CVE-2024-4577 vulnerability in PHP, you need to upgrade to a fixed version of the software. This critical vulnerability allows remote code execution (RCE) on Windows servers running PHP, exploited through the PHP-CGI script engine, even if PHP is not configured in CGI mode. The vulnerability affects PHP versions 8.1.* before 8.1.29, 8.2.* before 8.2.20, and 8.3.* before 8.3.8​

**Exploit**

[https://github.com/watchtowrlabs/CVE-2024-4577?tab=readme-ov-file](https://github.com/watchtowrlabs/CVE-2024-4577?tab=readme-ov-file) 

### Steps to Fix the Vulnerability

1. **Upgrade PHP**:
  - *8.1.* users*: Upgrade to at least version 8.1.29.
  - *8.2.* users*: Upgrade to at least version 8.2.20.
  - *8.3.* users*: Upgrade to at least version 8.3.8.
  - For other unsupported versions (7 and 5), consider upgrading to a supported version.
  You can download the latest version of PHP from the official [PHP website](https://www.php.net/downloads.php) or use your operating system's package manager.
2. **Disable CGI if not needed**: If you do not require CGI, it's recommended to disable it:
  - Open `C:/xampp/apache/conf/extra/httpd-xampp.conf`.
  - Comment out the lines related to CGI:
  - **Apply Rewrite Rules**: For older versions where an upgrade is not possible, consider applying rewrite rules:
    

### Importance of Immediate Action:

This vulnerability is actively being exploited, and due to its critical nature and the availability of proof-of-concept (PoC) code, it's highly likely to be exploited. It's essential to promptly upgrade and apply necessary patches to protect your servers from potential RCE attacks​ .


**Mitigation:**

![image](media://43de0baf-183d-4863-9b5e-721b1bf31070)

Cynergy has an automated mitigation capability that requires integration with your WAF provider.

Once integrated, you can request “Protect with WAF”

This will move the exposed asset behind WAF protection

<span style="color: #97a0af">**Note: **</span><span style="color: #97a0af">Policies configuration should be defined separately</span>