Opens in a new tab
Explainer

PHP2Shell: following the risk into the running worker

In brief

A PHP site can serve a healthy-looking page while its worker remains exposed. Separate the runtime fixes, the worker’s reach and the investigation into what happened before repair.

8 min read

Is this the right starting point?
Before you read
Basic familiarity with web applications, deployed runtimes, service accounts and software updates.
What you will take away
Separate confirmed PHP exposure from compromise claims and plan runtime verification, investigation and credential recovery.
Sources
A scuffed purple cartridge marked PHP projects from rails beneath a cream miniature machine, with a smoother lilac PHP cartridge beside it.
On this page6 sections

A PHP site can return an ordinary page while the process serving it remains vulnerable to attacker-supplied code. The page looks healthy because serving pages is not the only thing that process may now be able to do. Its access to application files and credentials is part of the concern.

PHP released fixes for two critical flaws that can allow code execution without an attacker first signing in: unauthenticated remote code execution. Update affected runtimes. If immediate updating is not feasible, the NSA recommends taking affected systems offline. [1]

Exposure is not proof of an intrusion, and control of a PHP worker does not automatically mean root, the machine’s administrator-level privileges. The advisory describes code running with the worker’s permissions. [3] The response therefore follows two related paths: replace the vulnerable runtime and investigate what its earlier exposure may have allowed.

What the worker carries from one request to the next

Before returning a page, PHP runs application code on the server. The process doing that work is a worker. Some workers stay alive to handle another request. Reuse is useful, but the next request must not inherit a reference to memory the previous request has already given up.

In CVE-2026-109618, a request runs out of memory before PHP finishes preparing internal data. Cleanup then treats that partial preparation as complete. Researchers demonstrated a path from that mistaken assumption to executing attacker-supplied code. With Apache’s mod_php integration, the vulnerable path can occur before application code starts. Updating WordPress or a plugin alone therefore does not fix the PHP runtime beneath it. [3]

CVE-2026-109619 concerns state left between requests. PHP frees memory belonging to an earlier request, while the persistent worker retains a pointer, a reference to where that data was. Under the required conditions, a later request follows the stale pointer before PHP reinitializes it. The worker and application path matter; this is not a claim that every request compromises every installation. [4]

Maintainers call for updates across FPM, Apache mod_php, CGI, FrankenPHP and LiteSpeed integrations. A clearer demonstration against one way of running PHP does not establish that the others are safe. [5]

The worker’s operating-system account determines what successful attacker code can reach. It may lack administrator rights yet still read a database password or other application secrets. A worker already running with elevated privileges has a wider reach. Inspect those permissions rather than assuming either total machine control or harmlessness. [3]

After successful exploitation, code runs as the PHP web-worker account. Application files, accessible secrets and connected services are reachable only within the worker’s permissions and available credentials. Root is not automatic.
Conceptual view of a compromised worker’s reach. Successful exploitation runs code with that worker’s privileges: accessible files, process secrets and service credentials define the exposure. Elevated worker privileges widen it.

AI helped the research; the claims still need their boundaries

Wiz reports using AI to build and adapt working exploits in research environments, including WordPress, Drupal and Joomla, and describes disclosure of process memory that can expose secrets. That is a concrete research finding. It is not evidence that every deployed instance was breached. [6]

The PHP Foundation traces signs of the memory problem back to 2024 and describes difficult compatibility and implementation decisions. The 2026 exploitation work clarified practical impact and accelerated repair. AI-assisted investigation contributed, while maintainers still had to develop, test and coordinate the fix. [7]

AWS reports attempts in its MadPot honeypots, including October 17, before disclosure. It leaves open whether those attempts would have succeeded against real systems. That moves the relevant investigation window earlier; it does not count compromised customer servers. [8]

A token bill also leaves out much of an intrusion’s cost: tooling, attempts, access and operator work. The reviewed material does not establish that one person spent about $50 to compromise the PHP ecosystem, or that one named model caused these incidents. The confirmed vulnerability is serious without borrowing those larger claims.

The key still works when someone else holds it

Suppose the worker retrieves an API key to call a model. If an attacker gains its ability to fetch and use that key, the model service receives requests carrying the same account permission. A secret manager reduces some accidental exposure, but cannot hide a key from a compromised runtime already authorized to retrieve it. Limit the key’s reach, record its use and retain a way to revoke it. [13]

Anthropic’s September report describes stolen customer API keys reused for other attacks and proxy services supporting illicit model distillation. A key may be used by its thief or offered as access to others. Distillation is the separate step of training on another model’s outputs, not the unauthorized access that obtains them. These are provider-reported findings. [9]

Railway’s preliminary October report describes unauthorized internal access and exposed customer secrets, recommending rotation for customers signed up before October 21. It does not identify PHP as the cause. At the check date, the investigation remained preliminary; the October 26 update said service for existing users had been restored. [10]

The shared concern is credential reach, not a claim that PHP caused all these incidents. A key limited to one application’s workload grants less than one shared across many services. For this worker, ask which accounts and operations its credentials actually open.

Read the October fixes as separate changes

The table lists the first upstream fixes for the original October 21 pair. Earlier releases on those branches need remediation, but a distribution may backport a fix without adopting the upstream version number. Check its advisory and exact package build rather than sorting version strings alone. [4] [11]

PHP branchFirst upstream release fixing the two October 21 issues
8.58.5.12
8.48.4.27
8.38.3.36
8.28.2.35

Older deployments need an upgrade or supported-backport decision. Include bundled PHP in appliances and products when locating affected runtimes. An application that still serves pages has not thereby shown that its runtime is repaired. [11] [12]

The separate October 23 notice concerns CVE-2026-115560: switching at runtime from php_binary or php_serialize to php before session_start(), with upload progress enabled. Its interim advice sets session.upload_progress.enabled=0 at startup and restarts workers, retaining the setting until the next regular bugfix release. Applications that never switch the serializer at runtime are outside this condition. [5] [11]

October 26 Windows rebuilds with a -1 suffix include Brotli 1.2.1 for a separate decompression flaw. cURL can reach that decoder when automatic response decompression is enabled, which is not its default. These rebuilds keep the PHP runtime version unchanged. [5]

Installing an October 21 release therefore answers one update question, not every later one. Use current maintainer and operating-system guidance for the actual change; this account describes the notices checked on October 26.

Find the worker that did not leave with the old package

Picture a fictional WordPress service with several PHP-FPM workers behind a load balancer. One host updates successfully. A worker on another host still runs old PHP and keeps receiving requests. Healthy pages from the first host cannot account for that remaining process.

Follow the update across every serving instance and confirm that old processes have left service. Ask which PHP binary the worker actually loaded; the command-line executable can differ from the web-serving one. Use the supported inspection and restart or replacement method for each pool, then run representative user operations through the repaired service. Keep configuration and secrets out of public responses while checking versions.

The risk-treatment guide distinguishes a delivered correction from the exposure it removes. Here the package job finishes before all running workers are shown to use the repaired runtime. Neither result establishes whether someone used the old worker before replacement.

Retain logs and deployment history for the security investigation. Unexpected files, processes, outbound connections or credential use may help reconstruct events; their absence is not a clean bill of health. NCSC advises considering compromise where prompt patching or disabling was impossible. AWS’s October 17 observation places relevant attempts before disclosure, and local records may justify looking further back. [8] [12]

Suppose there is reason to suspect compromise. Giving that worker a fresh key while it remains compromised may give the attacker the replacement too. Promptly revoke exposed credentials as part of containment rather than waiting for the whole service to recover. Recover the worker through trusted-state procedures, and issue replacement credentials only when the compromised process cannot retrieve them. Checking that the old credentials fail establishes that those credentials no longer work; it cannot retrieve data already copied. OWASP covers the relevant records and actions.

If the team cannot establish that a remaining worker is repaired, its owner faces the choice in NSA guidance: isolate it or take it offline while addressing exposure. Removing capacity has a cost, but leaving the known vulnerable path available has one too. [1]

An assistant can help locate the last worker or prepare an update for review. A “secure” verdict from that assistant cannot establish that the process was replaced or its old key stopped working. Those answers come from the serving instances and accounts involved.

At handover, leave more than the package-success message. Show which exposed workers were replaced, how the repaired service was checked and who owns remaining credential and investigation questions. The ordinary-looking page at the beginning did not reveal the old worker. Accounting for that worker gives the next responder a clearer picture, without pretending its departure explains everything it may have done before.

Sources and scope

The underlying advisory review was checked October 26, 2026. This article synthesizes primary advisories, research and incident reports; the service example is hypothetical. It reports no hands-on exploit test and does not establish compromise of any reader’s system. Maintainer guidance and investigation findings may change.

1. NSA: critical PHP patches and immediate precautions.

2. Video linked in the original article; contents not independently verified.

3. PHP advisory: CVE-2026-109618, out-of-memory corruption.

4. PHP advisory: CVE-2026-109619, stale request state.

5. PHP announcements: October 21, 23 and 26 guidance.

6. Wiz: PHP2Shell research and AI-assisted exploit development.

7. PHP Foundation: how the vulnerabilities were found and fixed.

8. AWS: pre-disclosure PHP2Shell attempts observed in MadPot.

9. Anthropic: September 2026 threat intelligence report.

10. Railway: preliminary October security incident report.

11. CERT-EU: PHP security advisory and vendor-update guidance.

12. NCSC: inventory, mitigation and compromise assessment.

13. OWASP: secrets management and incident response.

Source context

Source links appear within this article. Read them alongside the author’s analysis and evaluate the guidance against your environment.

Report an error or outdated detail

Keep reading

Where to go next