---
id: "CVE-2024-4577"
kind: "vulnerability"
aliases: ["CVE-2024-4577"]
title: "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\u2026"
severity: "critical"
cvss: 9.8
epss: null
exploited: true
status: "open"
category: "runtime"
products: [{"name": "PHP Group PHP", "fixed": [], "affected": "", "ecosystem": "vendor"}, {"name": "php", "fixed": ["8.1.29"], "affected": ">= 8.1.0, < 8.1.29", "ecosystem": "vendor"}, {"name": "php", "fixed": ["8.2.20"], "affected": ">= 8.2.0, < 8.2.20", "ecosystem": "vendor"}, {"name": "php", "fixed": ["8.3.8"], "affected": ">= 8.3.0, < 8.3.8", "ecosystem": "vendor"}, {"name": "fedoraproject fedora", "fixed": [], "affected": "= 39", "ecosystem": "vendor"}, {"name": "fedoraproject fedora", "fixed": [], "affected": "= 40", "ecosystem": "vendor"}]
ecosystems: ["vendor"]
tags: ["exploited", "php", "php-cgi", "poc-public", "ransomware", "runtime", "self-hosted", "windows"]
not_affected_if: ["linux-only", "no-cgi-mode", "php-fpm-or-mod-php"]
published_at: "2024-06-09T20:15:09+00:00"
first_seen_at: "2026-10-23T19:11:51+00:00"
updated_at: "2026-10-23T22:29:05+00:00"
sources: [{"source": "kev", "url": "https://www.cisa.gov/known-exploited-vulnerabilities-catalog?search_api_fulltext=CVE-2024-4577", "first_seen_at": "2026-10-23T19:11:51+00:00"}, {"source": "github-poc", "url": "https://github.com/Ghost-Bx1/POC-CVE-2026-109618-CVE-2026-109619-CVE-2024-4577", "first_seen_at": "2026-10-23T20:22:16+00:00"}, {"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-4577", "first_seen_at": "2026-10-23T22:29:05+00:00"}]
---

# 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…

PHP on Windows running in CGI mode mishandles command-line arguments, letting a remote request inject OS commands. An attacker gets arbitrary code execution on the web server with the privileges of the PHP process.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- vendor:PHP Group PHP affected ? fixed ?
- vendor:php affected >= 8.1.0, < 8.1.29 fixed 8.1.29
- vendor:php affected >= 8.2.0, < 8.2.20 fixed 8.2.20
- vendor:php affected >= 8.3.0, < 8.3.8 fixed 8.3.8
- vendor:fedoraproject fedora affected = 39 fixed ?
- vendor:fedoraproject fedora affected = 40 fixed ?

## How to check

Check whether PHP runs as CGI on Windows: run php -v and look for the CGI binary (php-cgi.exe) serving requests in IIS or Apache configuration.

## Fix

Upgrade PHP on Windows to a patched release from the PHP Group, or move off PHP-CGI to mod_php or PHP-FPM.
Discontinue use of the product if mitigations are unavailable, per CISA guidance.

## Timeline

- 2026-10-23T19:11:51+00:00 kev https://www.cisa.gov/known-exploited-vulnerabilities-catalog?search_api_fulltext=CVE-2024-4577
- 2026-10-23T20:22:16+00:00 github-poc https://github.com/Ghost-Bx1/POC-CVE-2026-109618-CVE-2026-109619-CVE-2024-4577
- 2026-10-23T22:29:05+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2024-4577

## Documents

- [poc] Ghost-Bx1/POC-CVE-2026-109618-CVE-2026-109619-CVE-2024-4577 https://github.com/Ghost-Bx1/POC-CVE-2026-109618-CVE-2026-109619-CVE-2024-4577

## From the sources

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.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
