If your organization is patching PHP2Shell today, investigate the systems that were exposed as well. A successful update closes the vulnerability. Any webshells, stolen credentials or other access established before that update still need to be found and addressed.
How PHP2Shell enables remote execution
PHP2Shell refers to two critical vulnerabilities in the PHP runtime, disclosed on 21 October 2026. Both are rated CVSS 9.2 and can allow an attacker without credentials to execute code with the web worker’s permissions. [1, 2]
CVE-2026-109618 involves memory exhaustion interrupting an operation while PHP’s internal state is incomplete. Request cleanup can then process that invalid state. CVE-2026-109619 involves a worker retaining references to freed memory from an earlier request and using them during a later one. Carefully crafted requests can turn these memory safety failures into code execution. [1, 2]
Apache mod_php is particularly exposed: a demonstrated attack executes before application code runs, so the application’s login checks cannot protect that path. Other deployments, including PHP-FPM, also need attention, although exploitability depends on the specific vulnerability and application conditions. [1, 2]
The first fixed releases are PHP 8.2.35, 8.3.36, 8.4.27 and 8.5.12. Apply the appropriate release or vendor-backported package, and restart or replace affected workers. Configuration workarounds do not provide a complete fix. [3]

A lesson from a previous Exchange investigation
Several years ago, I investigated an organization after an attacker attempted to encrypt systems across its estate using BitLocker. Fortunately, the encryption attempt failed. The ransom note was left behind.
In that previous case, we found two webshells on an on-premises Exchange server. The organization had patched that server within a day or two of the vulnerability becoming public and the Microsoft update becoming available. Several months later, after migrating to Office 365, it believed the server had been decommissioned.
The server was still online. The patch had worked, but the attacker had planted a webshell during the brief window before it was applied. Nearly a year later, the attacker returned through that surviving access.
This was a different vulnerability and technology, but the lesson applies directly to PHP2Shell. Patching can prevent exploitation of the original flaw while leaving an attacker’s existing foothold intact. Migrating a service also needs a verified shutdown of the systems it replaces.
Hunt for what the attacker could have left behind
A webshell is server-side code that an attacker can reach over HTTP to issue commands or perform other actions. Once it is present, requests to it may use legitimate application functionality without triggering the original vulnerability again.
Search potentially affected hosts for unexpected scripts in web roots, upload directories and other application-writable locations. Compare files with trusted application releases and deployment records. Include unusual extensions and older files: attackers can disguise names and alter timestamps.
Correlate suspicious files with requests to their URLs, PHP errors, process execution and outbound connections. Large form submissions, memory-exhaustion errors and unexpected shells spawned by web workers are useful investigation leads. Successful execution may return HTTP 200 without crashing the worker. [4]
Preserve evidence before removing suspected shells. Then investigate associated accounts, scheduled execution, services and exposed secrets. A search that finds no webshells cannot exclude other persistence or credential theft.

Illustrative PHP timeline: a webshell planted before patching may remain usable after the update.
Two starting rules for your investigation
The companion download includes a Sigma rule for Linux web workers directly spawning shells, plus a YARA rule for PHP files containing both request-input references and code or command execution functions. Use Sigma against retained process telemetry or new events, and YARA against collected files.
These are hunting rules for possible compromise, not vulnerability scanners or definitive PHP2Shell signatures. Legitimate applications can match. Obfuscated shells, indirect execution and activity outside their coverage can be missed. Validate field mappings, tune against your environment and investigate matches in context.
Make investigation part of the response
For Binalyze AIR users, the practical next step is an evidence-led investigation of exposed hosts: collect relevant files and logs, examine suspected persistence and establish what happened during the exposure window. Include systems believed to be retired and verify that they are actually offline.
Patch promptly, and give the search for surviving attacker access the same urgency. A completed patch ticket is evidence of remediation of the flaw. Determining whether an attacker already used it requires investigation.
Need hands-on help investigating PHP2Shell exposure? Our Support & Services team can help. → Talk to a Binalyzer
Sources and companion rules
[1] CVE-2026-109618 and PHP security advisory
[2] CVE-2026-109619 and PHP security advisory
[3] CERT-EU advisory and patch guidance
[4] Datadog Security Labs technical analysis and detection observations
Companion files: php_web_worker_shell.yml, php_webshell_candidates.yar and RULES_README.txt. These draft rules require local validation before operational use.