ACT NOW Cybersecurity 20 min read

PHP flaw: how a single visit can take over a website's server

A PHP flaw lets a stranger take over a server with as little as one web request. Attack code is out. So is the fix, except for PHP inside products you bought.

The 60-second brief

Online shops, booking systems and customer portals built on PHP are already being taken over, and PHP built into equipment a company bought stays open until its maker ships a fix.

What happened

PHP builds the pages of a huge share of the world's websites — shops, booking systems, customer portals. On 21 October it fixed two flaws that let a stranger make the server run their own commands, before anyone logs in.

Who's exposed

Any company with a website or service built on PHP, and any running network equipment or software with PHP built in. PHP 8.1 and older get no fix.

The catch

Updating fixes the servers you run. PHP inside a bought product can only be fixed by its maker, and the update can't remove a backdoor left before it.

VerdictAct now
Cost to fixIT time, possible downtime
EvidenceNCSC, CISA and PHP alerts
Read20 minutes

What happened

How one visit takes over a server, and what updating doesn't fix

Every time someone opens a page, PHP builds it on the server. It does not keep a ready-made page waiting — it assembles a fresh one for each visitor, pulling in things like the right prices, the person's name and what is in their cart, then sends back the finished page. It does all this before the website's own code runs and before anyone logs in. A visit built to run PHP out of memory at exactly the wrong moment leaves it half-finished. PHP then treats the half-built data as real, and that lets the visitor run their own commands on the server. Where PHP is part of the web server (IT calls this mod_php), that one visit is enough.

Get that far, and the stranger can reach whatever the server can — the customer list, orders, payment settings — to copy it, change the site, or leave a hidden way back in. This is no longer hypothetical: CISA now lists both flaws as used in real attacks.

The 1-minute explainer: the problem and who it hits.

A customer

MemoryEnough to build the page
PHPBuilds the page

Sees the page

The attacker

MemoryUsed up at the wrong moment
PHPTreats half-built data as real

The server runs their commands, no password

Same website, same PHP. One visit timed to run PHP out of memory is all it takes.

The leak is why the clock matters. The details went public on 20 October, a day before PHP's fix; when CISA issued its alert on 21 October it had not yet seen a successful attack, and by 26 October it did. Updating now is how you stay on the right side of that line.

You would expect the update to end it there. It doesn't, for two reasons. First, it can't reach PHP built into products you bought — the maker has to fix those, and days after the release some still had no fix. Second, it can't undo a break-in that happened first, so any server that sat unpatched for days needs checking.

Our view

Almost every company runs PHP somewhere, often where no one remembers putting it. The update is the easy part; knowing every place PHP runs is the hard part. Start that list today.

Join free to read the rest

Join free to read how they did it, the exposure check, the fix step by step, how to be ready for the next one, and what we don't know yet.

Copied