Blog

PHP2Shell flaws exploited: what a web server's account could read

The story: Security advisory: Critical remote code execution vulnerabilities, update now · PHP (php.net) ·

Topics: Linux

On 26 October 2026 CISA listed two critical PHP flaws, nicknamed PHP2Shell, as exploited; Amazon saw the first attempt on 17 October, before the fix. What happened, what to do first, and why the hard question afterwards is what the web server's account read.

A web server drawn as three stacked units, with lines to three folders; one folder is marked.

On 21 October 2026 the PHP project fixed two flaws that let an attacker run code on a web server without logging in, and urged every PHP user to update immediately. On 26 October the US Cybersecurity and Infrastructure Security Agency (CISA) listed both as exploited. Patching comes first. The question that follows for anyone running PHP sites is harder: if a server was used, what did the attacker's code read?

What happened

The flaws, nicknamed PHP2Shell, are CVE-2026-109618 and CVE-2026-109619, both rated 9.2 out of 10. In order:

Timeline, October 2026: Amazon sees a first attempt on 17 October; PHP announces a fix on 20 and releases it on 21; an extra setting is advised on 23; 35 shell executions on decoy servers on 24; CISA lists both flaws as exploited on 26.
Dates from Amazon, PHP and CISA; the decoy-server count is a researcher's, as reported by The Register.

What isn't known: as of 27 October, The Register reported, CISA had not named any organization that was compromised or said how many real servers were broken into. Amazon says it is unclear whether the attempts it saw would have succeeded on real systems.

What it means

The advisories are precise about what an attacker gets. For the first flaw, "remote code execution as the web worker account" (GHSA-w8hw-w9fx-j79w). For the second, "memory disclosure and remote code execution with the web worker's privileges" (GHSA-6wmf-4rv5-p3rp).

So the question after an incident is not what the attacker could do on the whole machine, but what the account PHP runs as could open. On a typical PHP site that account reads the site's code and its configuration on every request, and that configuration is where the secrets sit: a WordPress site's wp-config.php holds its database password, and many frameworks keep API keys in a .env file. Add anything else the same account can reach, such as other sites run under it, backups left in the web root, or deploy keys.

Diagram: code running as the PHP web worker account can read the site's code and configuration, and other sites or backups where that account can reach them; data leaked from the worker's memory involves no file being opened.
What code running as the web worker account can reach, from PHP's two advisories. Other sites and backups only where that account can open them.

Two things make this hard to answer afterwards.

First, the second flaw can leak memory. Data taken from a worker's memory leaves without any file being opened, so no record of file access would show it.

Second, most servers keep no record of reads. A web server's access log shows requests, not which files the code behind them opened, and PHP says the mod_php attack can trigger "before any application code runs", so the application's own logs may show nothing. By default, Linux doesn't log file reads at all; that takes audit rules set up beforehand.

Where no record exists from 17 October onwards, an honest investigation often ends with "we can't tell". In practice that means treating every secret the web worker account could read as exposed.

What you can do

Update. Move to 8.5.12, 8.4.27, 8.3.36 or 8.2.35, or your distribution's patched package, and restart every worker. The NCSC also asks you to track appliances and services that bundle PHP.

Look back from 17 October, not 21. Amazon's advice is to start an investigation from the earliest known exploitation, and to check web servers for unexpected processes and changed files. To list PHP files changed in a web root since then:

find /var/www -type f -name '*.php' -newermt '2026-10-17'

Rotate what the worker could read wherever you find signs of compromise or can't rule it out: database passwords, API keys, tokens.

Start recording reads now. A rule on the site's own configuration would fire on every request, so watch folders the web worker account should never open. With auditd, a rule in the syscall form the manual recommends, then a search of what it caught:

auditctl -a always,exit -F arch=b64 -F dir=/home/ -F uid=www-data -F perm=r -k web-reads
ausearch -k web-reads -i

Replace www-data with the account your PHP workers run as, and /home/ with a folder they have no reason to read. The limits are familiar: rules go on one server at a time, busy folders produce a lot of noise, and the history lasts only as long as the audit log is kept.

Where ProofStream fits

ProofStream records which program opened which folder, and when, on each Linux, Windows and Mac machine, and keeps that history searchable for months. Had it been running on a PHP server since before 17 October, it would show the folders the PHP workers and any other program, a shell or curl for example, opened since then, so a web worker reading a home folder or another site's folder would be on the record. It records the folder, not the file, outside folders a customer chooses, and a read of the site's own configuration looks like ordinary traffic. It sees nothing taken from memory or sent over the network, and it can't block an exploit. How it works.

Sources

Spotted a mistake? Tell us and we'll correct it.