PHP2Shell on Windows Server: how to check
On 21 October 2026, PHP shipped emergency fixes for two critical flaws, together nicknamed PHP2Shell. If your Windows server doesn’t run PHP, you’re not affected. If it does, update today.
What happened
The two vulnerabilities, CVE-2026-109618 and CVE-2026-109619, are both rated 9.2 under CVSS v4.0. They let an unauthenticated attacker run code on any server where PHP handles web requests. The bugs sit in PHP itself, not in WordPress or any plugin, so a stock install on an affected version is exposed.
PHP’s maintainers issued an urgent warning on the evening of 20 October and released fixed versions the next day. Attackers didn’t wait: Amazon’s threat intelligence team recorded an exploitation attempt as early as 17 October, four days before the fix, and more attempts followed once the news broke. Several governments and some companies, including Nintendo, took services offline as a precaution until they could patch.
Why most Windows servers aren’t exposed
PHP2Shell only matters where PHP is installed and serving web requests. A typical Windows VPS running IIS with ASP.NET, .NET or static sites has no PHP runtime, so there is nothing for these bugs to reach.
On Windows, PHP usually runs through IIS’s FastCGI module, as php-cgi.exe. Less often it runs under Apache, nginx or a standalone process. If none of those are present, the server is not affected.
PHP can also hide inside other software. Some management tools, control panels and appliances bundle their own copy, and at least one remote-management vendor paused its service this week to patch it. If you rely on tools like these, check their vendors’ advisories too.
Cloudflare has deployed emergency firewall rules against the known attack patterns for all its customers, including those on the free plan. That’s a useful extra layer if your site sits behind Cloudflare, but it doesn’t replace a check. Know what runs on your own server.
How to check your own server
If you’re a ZerOne Hosting client, you don’t need to do anything. We’ve already checked every server we manage, and none are at risk. The checks below are for everyone else: if you run your own Windows server, or one with another provider, this is how to find out whether PHP2Shell can reach it.
Four quick checks in an elevated Windows PowerShell window show whether PHP is serving anything on your server. If checks 1 to 3 return nothing, and nothing unfamiliar shows up in check 4, PHP isn’t serving anything on that server. If your site passes requests to PHP running elsewhere (another server, a container or WSL), check that system too.
All of these commands only read information; none of them change anything on your server. On a busy server, check 2 can take several minutes and adds some disk activity, so consider running it outside peak hours. To keep it from competing with your sites for resources, you can first lower PowerShell’s priority with (Get-Process -Id $PID).PriorityClass = 'BelowNormal'. You can stop any of the commands at any time with Ctrl+C.
First, load IIS’s PowerShell module, which checks 1 and 2 need:
Import-Module WebAdministration
If that fails, IIS is either not installed or installed without its management tools. Find out with:
Get-Service W3SVC -ErrorAction SilentlyContinue
If it returns nothing, there’s no IIS, so skip to check 3. If it shows a service, IIS is there but its module isn’t. Skip check 1, run the first command in check 2 as it is, and use this instead of its second command. It searches the default site folder, C:\inetpub; if your sites live elsewhere, run it on those folders too.
Get-ChildItem C:\inetpub -Recurse -Filter web.config -ErrorAction SilentlyContinue |
Select-String -Pattern 'php' -List
- List the FastCGI applications registered in IIS. On Windows, PHP usually shows up here as
php-cgi.exe.
Get-WebConfiguration -PSPath 'MACHINE/WEBROOT/APPHOST' -Filter 'system.webServer/fastCgi/application' |
Select-Object fullPath
- Search IIS’s configuration for anything PHP-related: first its main settings file, then every
web.configfile in the folders of your sites, applications and virtual directories. A match deserves a closer look but isn’t proof of PHP; a rule that redirects old.phpaddresses would match too. On a server with many sites or files, the second command can take several minutes, but it stays light on memory.
Select-String -Path "$env:windir\System32\inetsrv\config\applicationHost.config" -Pattern 'php'
@(Get-Website) + @(Get-WebApplication) + @(Get-WebVirtualDirectory) |
ForEach-Object { [Environment]::ExpandEnvironmentVariables($_.PhysicalPath) } | Sort-Object -Unique |
ForEach-Object { Get-ChildItem -LiteralPath $_ -Recurse -Filter web.config -ErrorAction SilentlyContinue } |
Select-String -Pattern 'php' -List
- Look for PHP, Apache, nginx, Caddy or FrankenPHP, both as running processes and as installed Windows services. IIS only starts PHP when a request needs it, so an idle server may show no process even when PHP is installed; checks 1 and 2 cover that case.
Get-Process php*, httpd*, nginx*, caddy*, frankenphp* -ErrorAction SilentlyContinue
Get-CimInstance Win32_Service | Where-Object PathName -match 'php|httpd|nginx|caddy|frankenphp' |
Select-Object Name, State, PathName
- List listening ports, the address each one listens on, and the process behind it. An address of
127.0.0.1or::1means the port is only reachable from the server itself. Ports owned bySysteminclude IIS (through HTTP.sys), but also Windows services such as file sharing (445) and remote management (5985). Anything you don’t recognise deserves a closer look.
Get-NetTCPConnection -State Listen |
Select-Object LocalAddress, LocalPort, @{n='Process';e={(Get-Process -Id $_.OwningProcess -ErrorAction SilentlyContinue).Name}} |
Sort-Object LocalPort, LocalAddress -Unique
Check 4 shows what’s listening; your firewall and network settings decide what’s actually reachable from the internet. While you’re there, make sure only the ports you need, usually 80 and 443, are open to it.
These checks are general guidance, provided as-is. Run them at your own discretion, and if you’re not sure, ask whoever manages your server.
If you do run PHP on Windows
Update to a fixed release today: PHP 8.2.35, 8.3.36, 8.4.27 or 8.5.12, or later. Windows builds are on windows.php.net. Check your version with php -v, then recycle the IIS application pools so the new binaries load.
- PHP 8.2: 8.2.35 fixes these flaws, but PHP 8.2 reaches end of life on 31 December 2026 and gets no security fixes after that. Plan the move to 8.3 or later now.
- PHP 8.1 or older: these branches are out of support, although the flaws reach back to PHP 5.4. PHP’s security team has published minimal source-code fixes for 7.4, 8.0 and 8.1, but they’re aimed at people who build PHP themselves. For everyone else, the answer is an upgrade to a supported branch. Plan it now.
- Can’t update right away: take the site offline or restrict access to trusted IPs until you can. PHP’s advisory lists interim settings, the main one being
session.upload_progress.enabled=0in php.ini, followed by a restart of PHP. They reduce some attack paths but don’t make a server safe; only the update does. - After updating: look for recently modified or unfamiliar
.phpfiles, especially in upload and temp folders, since attacks began before the fix shipped.
Who patches your server?
Over the past two days, hosting providers sent their customers very different emails about PHP2Shell. Managed hosts wrote to say they had already patched everything and no action was needed. Providers of unmanaged servers wrote to say the opposite: on a server you run yourself, installing the update is your job, and so is watching for signs of an attack.
Neither is wrong. It’s the difference between paying for a server and paying for a server with someone looking after it. If you got the second kind of email this week, make sure someone actually acted on it.
What we did
When the news broke, we started with our records of what runs on every server we manage, to see straight away where we stood. None showed PHP exposed to the internet. We then double-checked every server anyway, in case a record had missed something. None were at risk from PHP2Shell. Our own website is a static site with no PHP runtime, so it was never affected either.
We’re keeping an eye on further developments, such as public exploits or follow-up patches.
Sources
- PHP: Security advisory, critical remote code execution vulnerabilities
- Wiz Research: PHP2Shell
- The Register: PHP devs publish critical bug fix
- Sansec: PHP2Shell timeline and update notes
- Help Net Security: PHP2Shell patched, fixed versions and mitigations
- The Record: Websites taken offline over the PHP vulnerabilities
This post is general information, not professional advice for your specific setup.