{
    "title": "CVE-2024-4577: the PHP-CGI flaw on Windows explained",
    "seo_title": "CVE-2024-4577: the PHP-CGI vulnerability on Windows",
    "h1": "CVE-2024-4577: the PHP-CGI flaw on Windows explained",
    "description": "CVE-2024-4577: who is affected (PHP-CGI on Windows, XAMPP), mass exploitation, fixed versions and what to check on a WordPress site.",
    "lead": "A Windows character conversion reopened a twelve-year-old PHP-CGI vulnerability. Exposure conditions, exploitation timeline, fixed versions and what to check.",
    "language": "en",
    "locale": "en-US",
    "type": "article",
    "url": "https://www.wp-feint.com/php-cgi-cve-2024-4577-windows-flaw/",
    "canonical": "https://www.wp-feint.com/php-cgi-cve-2024-4577-windows-flaw/",
    "markdown": "https://www.wp-feint.com/php-cgi-cve-2024-4577-windows-flaw/index.md",
    "json": "https://www.wp-feint.com/php-cgi-cve-2024-4577-windows-flaw/index.json",
    "published": "2026-07-27T07:00:00+00:00",
    "modified": "2026-11-22T12:09:01+00:00",
    "site": {
        "name": "WP Feint",
        "url": "https://www.wp-feint.com/"
    },
    "translations": [
        {
            "language": "en",
            "hreflang": "en-US",
            "title": "CVE-2024-4577: the PHP-CGI flaw on Windows explained",
            "url": "https://www.wp-feint.com/php-cgi-cve-2024-4577-windows-flaw/",
            "markdown": "https://www.wp-feint.com/php-cgi-cve-2024-4577-windows-flaw/index.md",
            "json": "https://www.wp-feint.com/php-cgi-cve-2024-4577-windows-flaw/index.json"
        },
        {
            "language": "fr",
            "hreflang": "fr-FR",
            "title": "CVE-2024-4577 : la faille PHP-CGI sous Windows expliquée",
            "url": "https://www.wp-feint.com/fr/php-cgi-cve-2024-4577/",
            "markdown": "https://www.wp-feint.com/fr/php-cgi-cve-2024-4577/index.md",
            "json": "https://www.wp-feint.com/fr/php-cgi-cve-2024-4577/index.json"
        },
        {
            "language": "es",
            "hreflang": "es-ES",
            "title": "CVE-2024-4577: la vulnerabilidad de PHP-CGI en Windows, explicada",
            "url": "https://www.wp-feint.com/es/php-cgi-cve-2024-4577-windows/",
            "markdown": "https://www.wp-feint.com/es/php-cgi-cve-2024-4577-windows/index.md",
            "json": "https://www.wp-feint.com/es/php-cgi-cve-2024-4577-windows/index.json"
        },
        {
            "language": "de",
            "hreflang": "de-DE",
            "title": "CVE-2024-4577: die PHP-CGI-Lücke unter Windows erklärt",
            "url": "https://www.wp-feint.com/de/php-cgi-cve-2024-4577-windows-luecke/",
            "markdown": "https://www.wp-feint.com/de/php-cgi-cve-2024-4577-windows-luecke/index.md",
            "json": "https://www.wp-feint.com/de/php-cgi-cve-2024-4577-windows-luecke/index.json"
        },
        {
            "language": "it",
            "hreflang": "it-IT",
            "title": "CVE-2024-4577: la falla PHP-CGI su Windows spiegata",
            "url": "https://www.wp-feint.com/it/php-cgi-cve-2024-4577-falla-windows/",
            "markdown": "https://www.wp-feint.com/it/php-cgi-cve-2024-4577-falla-windows/index.md",
            "json": "https://www.wp-feint.com/it/php-cgi-cve-2024-4577-falla-windows/index.json"
        },
        {
            "language": "pt",
            "hreflang": "pt-BR",
            "title": "CVE-2024-4577: a falha do PHP-CGI no Windows explicada",
            "url": "https://www.wp-feint.com/pt/php-cgi-cve-2024-4577-falha-windows/",
            "markdown": "https://www.wp-feint.com/pt/php-cgi-cve-2024-4577-falha-windows/index.md",
            "json": "https://www.wp-feint.com/pt/php-cgi-cve-2024-4577-falha-windows/index.json"
        },
        {
            "language": "nl",
            "hreflang": "nl-NL",
            "title": "CVE-2024-4577: het PHP-CGI-lek op Windows uitgelegd",
            "url": "https://www.wp-feint.com/nl/php-cgi-cve-2024-4577-lek-windows/",
            "markdown": "https://www.wp-feint.com/nl/php-cgi-cve-2024-4577-lek-windows/index.md",
            "json": "https://www.wp-feint.com/nl/php-cgi-cve-2024-4577-lek-windows/index.json"
        }
    ],
    "headings": [
        {
            "level": 1,
            "text": "CVE-2024-4577: the PHP-CGI flaw on Windows explained"
        },
        {
            "level": 2,
            "text": "What the vulnerability allows"
        },
        {
            "level": 2,
            "text": "Who is actually affected"
        },
        {
            "level": 2,
            "text": "Very fast exploitation"
        },
        {
            "level": 2,
            "text": "What to check"
        },
        {
            "level": 3,
            "text": "On a production WordPress site"
        },
        {
            "level": 3,
            "text": "On your development machine"
        },
        {
            "level": 3,
            "text": "If a server was exposed without the fix"
        },
        {
            "level": 2,
            "text": "With WP Feint"
        },
        {
            "level": 3,
            "text": "Key takeaways"
        },
        {
            "level": 2,
            "text": "Sources"
        }
    ],
    "body": "In June 2024, a critical PHP vulnerability was exploited less than two days after the fix was released. **CVE-2024-4577** only affects one specific setup, PHP in CGI mode on a Windows server, but that setup was the XAMPP default. Here you will find out whether your sites are affected, what happened and what to check.\n\n## What the vulnerability allows\n\nAccording to the NVD entry, the flaw affects PHP 8.1 before 8.1.29, 8.2 before 8.2.20 and 8.3 before 8.3.8, when PHP runs in **CGI mode** behind [Apache](https://www.wp-feint.com/glossary/apache-http-server/) **on Windows**. An anonymous visitor can then pass command-line options to the PHP binary, which makes it possible to read the source code of scripts or to run arbitrary PHP code on the server. The [CVSS 3.1](https://www.wp-feint.com/glossary/cvss/) score is **9.8 out of 10**, assigned by both the PHP team and NIST.\n\nThe principle fits in one sentence: Windows applies a so-called \"Best-Fit\" conversion to certain characters when it passes a command line to a program. With code pages 932 (Japanese), 936 (Simplified Chinese) and 950 (Traditional Chinese), a harmless-looking character is converted into a plain hyphen. PHP-CGI then takes it as the start of an option. The PHP advisory describes this behavior as a **bypass of CVE-2012-1823**, a 2012 flaw in the same CGI mode whose protection relied precisely on detecting that hyphen.\n\nResearcher Orange Tsai (DEVCORE) reported it on May 7, 2024. The fixed versions were released on June 6, 2024.\n\n## Who is actually affected\n\nThe exposure condition is narrow, which is good news for most WordPress sites. The DEVCORE advisory describes two scenarios:\n\n- Apache configured to pass PHP files to the `php-cgi` executable (`Action` directive);\n- a `php-cgi.exe` or `php.exe` executable exposed in a CGI directory, for example through `ScriptAlias`. This was the **default configuration of XAMPP for Windows**, widely used to develop WordPress sites locally.\n\nDEVCORE confirmed direct code execution on systems set to Traditional Chinese, Simplified Chinese and Japanese. For other languages (English, Korean, Western European languages), the advisory says it cannot yet enumerate every scenario and recommends updating in all cases. A Windows server set to French, for instance, should not be considered safe by default.\n\n![Decision tree: Windows server, PHP in CGI mode, unpatched version; if all three answers are yes, the site is exposed](https://www.wp-feint.com/media/2026/10/arbre-exposition-en.webp)\n\n| Configuration | Exposed to CVE-2024-4577? | Comment |\n| --- | --- | --- |\n| Linux shared hosting (Apache, LiteSpeed, Nginx) | No | The flaw depends on a conversion specific to Windows |\n| Linux VPS with PHP-FPM | No | Same |\n| Windows server, PHP as a module or via FastCGI | No, according to the advisory | DEVCORE actually recommends migrating to mod_php, FastCGI or PHP-FPM |\n| Windows server, Apache + PHP-CGI | Yes, if the version is unpatched | Main case described by DEVCORE |\n| XAMPP for Windows (default install) | Yes, if the version is unpatched | Especially risky if the machine is reachable from the internet |\n\n*Exposure by hosting setup*\n\nThe PHP 8.0, 7 and 5 branches are all affected but are no longer maintained: **no fixed version** exists for them. DEVCORE offered temporary Apache rewrite rules for these cases, noting that they only cover the three confirmed code pages.\n\n## Very fast exploitation\n\nThe timeline shows how quickly a published vulnerability becomes a weapon.\n\n![Timeline from May 2024 to January 2025: report, fix, first attacks, CISA catalog, fix for the bypass, 2025 campaigns](https://www.wp-feint.com/media/2026/10/chronologie-en.webp)\n\n- **June 8, 2024**: Imperva observes the first attacks, used to distribute the *TellYouThePass* [ransomware](https://www.wp-feint.com/glossary/ransomware/).\n- **June 12, 2024**: CISA adds the vulnerability to its catalog of actively exploited vulnerabilities (KEV).\n- **July 2024**: Akamai reports attempts on its honeypots within 24 hours of disclosure, involving several malware families (remote access trojan, cryptocurrency miner).\n- **September 26, 2024**: PHP 8.3.12, 8.2.24 and 8.1.30 fix **CVE-2024-8926**, a bypass of the first fix that is possible with certain non-standard Windows code page configurations.\n- **Early 2025**: Cisco Talos describes a campaign against Japanese organizations (technology, telecoms, entertainment, education, e-commerce) that uses CVE-2024-4577 as its entry point. GreyNoise counts **1,089 distinct IP addresses** attempting exploitation in January 2025 alone, well beyond Japan.\n\nSix months after the fix, the vulnerability was still being actively hunted. This is the usual pattern: bots keep scanning the internet as long as unpatched servers respond.\n\n| PHP branch | Fixes CVE-2024-4577 | Also fixes CVE-2024-8926 | Status in October 2026 |\n| --- | --- | --- | --- |\n| 8.3 | 8.3.8 | 8.3.12 | Maintained (security fixes until December 31, 2027) |\n| 8.2 | 8.2.20 | 8.2.24 | Maintained until December 31, 2026 |\n| 8.1 | 8.1.29 | 8.1.30 | End of life since December 31, 2025 |\n| 8.0 and earlier | No fix | No fix | End of life |\n\n*Versions to install*\n\nDo not aim only for the minimum version that fixes this vulnerability: install the **latest release of your branch**. In October 2026, PHP again released critical fixes (8.5.12, 8.4.27, 8.3.36 and 8.2.35) for two other code execution flaws which, unlike this one, affect every execution mode. We cover them in detail in our article on end-of-life PHP versions.\n\n## What to check\n\n### On a production WordPress site\n\nIn the Dashboard, open **Tools, Site Health, Info tab**, then the **Server** section. There you will find the server architecture (Windows or Linux), the web server, the PHP version and the PHP SAPI, that is, the way PHP is run. On Linux, whatever the SAPI, the site is not affected. On Windows, the `cgi-fcgi` SAPI alone does not let you tell classic CGI from FastCGI: ask your host or your administrator how PHP is invoked, and update PHP in any case.\n\n### On your development machine\n\n- Update XAMPP or replace its PHP version with a fixed one.\n- If you do not need CGI mode, DEVCORE advises commenting out the `ScriptAlias /php-cgi/` line in `httpd-xampp.conf`.\n- Make sure Apache is not listening on all network interfaces and that Windows Firewall does not expose it: a local environment should never be reachable from the internet.\n\n### If a server was exposed without the fix\n\nUpdating PHP closes the door, but it does not remove anything that may have been planted before. The campaigns described by Talos installed persistence tools (scheduled tasks, services, registry keys). Treat the machine as potentially compromised: look for unknown PHP files, added administrator accounts and suspicious scheduled tasks, and change the passwords and the keys in `wp-config.php`.\n\n## With WP Feint\n\nNo WordPress plugin fixes a PHP vulnerability: the only answer is to update the server. WP Feint can still help you see and verify. The [bot traps](https://www.wp-feint.com/features/bot-traps/) count requests that probe for nonexistent paths on your site, which is useful for measuring automated scanning. With the Pro version, the [integrity check](https://www.wp-feint.com/features/wordpress-integrity-check/) compares core files against the official wordpress.org checksums, and [email alerts](https://www.wp-feint.com/features/email-alerts/) flag a modified or added file, which helps after an exposure.\n\n*Black Hat Europe 2024 talk by Orange Tsai and Splitline Huang (DEVCORE) on Windows \"Best-Fit\" conversions, the mechanism exploited by CVE-2024-4577.*\n\n### Key takeaways\n\n- CVE-2024-4577 affects PHP in CGI mode on Windows, including the XAMPP default: Linux hosting is not affected.\n- Fixed versions: 8.3.8, 8.2.20 and 8.1.29, then 8.3.12, 8.2.24 and 8.1.30 for the CVE-2024-8926 bypass.\n- Exploitation observed from June 8, 2024, still active in 2025.\n- PHP 8.0 and earlier have no fix: the only solution is to migrate.\n- After an exposure, updating is not enough: look for signs of compromise.\n\n## Sources\n\n- [NVD: CVE-2024-4577](https://nvd.nist.gov/vuln/detail/CVE-2024-4577)\n- [PHP: security advisory GHSA-3qgc-jrrr-25jv](https://github.com/php/php-src/security/advisories/GHSA-3qgc-jrrr-25jv)\n- [NVD: CVE-2024-8926 (patch bypass)](https://nvd.nist.gov/vuln/detail/CVE-2024-8926)\n- [PHP: ChangeLog for the 8 branch](https://www.php.net/ChangeLog-8.php)\n\nOther sources consulted: official documentation and security research publications.",
    "categories": [
        "PHP vulnerabilities"
    ],
    "format": "application/json"
}