Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2024-4577 PoC — Argument Injection in PHP-CGI

Source
Associated Vulnerability
Title:Argument Injection in PHP-CGI (CVE-2024-4577)
Description:In PHP versions 8.1.* before 8.1.29, 8.2.* before 8.2.20, 8.3.* before 8.3.8, when using Apache and PHP-CGI on Windows, if the system is set up to use certain code pages, Windows may use "Best-Fit" behavior to replace characters in command line given to Win32 API functions. PHP CGI module may misinterpret those characters as PHP options, which may allow a malicious user to pass options to PHP binary being run, and thus reveal the source code of scripts, run arbitrary PHP code on the server, etc.
Description
CVE-2024-4577 is a critical vulnerability in PHP affecting CGI configurations, allowing attackers to execute arbitrary commands via crafted URL parameters.
Readme
Orange Tsi 🍊

This vulnerability was found by Orange Tsai (@orange_8361) of DEVCORE (@d3vc0r3). Make sure to follow his outstanding research, our role was to only recreate and develop the exploit for this issue.
Security Alert: CVE-2024-4577 PHP CGI Argument Injection Vulnerability

Overview
CVE-2024-4577 is a critical vulnerability in PHP affecting CGI configurations, allowing attackers to execute arbitrary commands via crafted URL parameters.

Affected Versions
PHP 8.3 < 8.3.8
PHP 8.2 < 8.2.20
PHP 8.1 < 8.1.29

Attack Vector
Attackers can exploit this by sending specially crafted requests to the PHP CGI script, injecting malicious parameters to execute arbitrary commands. This can lead to full system compromise.

Mitigation
- Upgrade to the latest PHP version(It is strongly recommended that all users upgrade to the latest PHP versions of 8.3.8, 8.2.20, and 8.1.29)
- Sanitize and validate input parameters.
- Use secure configuration settings to limit CGI parameter handling.


How to Use
Python Script
Install the requests library:
pip install requests
Run the script:
python test_cgi_vulnerability.py
Enter the URL to test when prompted.


Go Script
Make sure Go is installed on your system.
Run the script:
go run test_cgi_vulnerability.go
Enter the URL to test when prompted.
Notes
These scripts check for the vulnerability by sending harmless payloads and examining the response.
Ensure you have permission to test the target server.
Adjust the payloads or URLs as necessary for your specific setup.
Install the requests library:
pip install requests
Run the script:
python test_cgi_vulnerability.py
Enter the URL to test when prompted.

Go Script
Run the script:
go run test_cgi_vulnerability.go
Enter the URL to test when prompted.
Notes
These scripts check for the vulnerability by sending harmless payloads and examining the response.
Ensure you have permission to test the target server.
Adjust the payloads or URLs as necessary for your specific setup.
File Snapshot

[4.0K] /data/pocs/60d8d75229b91cc17765da80bb82b1b2a7e5dc23 ├── [380K] cve-2024-4577_calc.jpg ├── [1.4K] cve_2024_4577.go ├── [117K] cve-2024-4577_php info.png ├── [1.4K] cve_2024_4577.py └── [1.9K] README.md 0 directories, 5 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →