*Note: This is an actively developing situation and the information from this blog is accurate as of writing. Please refer to PHP’s official guidance for any newly released information and additional patching and mitigation recommendations.
The newly released ‘PHP2Shell’ vulnerabilities have become a hot topic hitting the desks, feeds and wires of every cybersecurity professional around the world. Starting October 20th, leaked details, disputed PoCs, conflicting exploitation reports and a patch that was scheduled but not yet released started circulating among security professionals online.
TL;DR – LPHP2Shell is a critical, highly exploitable set of two vulnerabilities that could potentially affect a massive percentage of internet facing websites. The patch is available and the time to patch is now.
The instinct during these types of high-impact vulnerability disclosures is to either panic or wait for certainty. Panic can lead to uncoordinated patching and inconsistent workarounds. Waiting means the exploit code is circulating before you hit your change window.
It wasn’t until PHP released their official post announcing the two CVEs and the mitigation options that the world was able to definitively understand the impact and start implementing patch management strategies.
This is why a balanced approach works best: act on what’s confirmed, prepare for what’s coming and make deliberate decisions about the tradeoffs you’re accepting.
All PHP installations serving web requests, including PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed are affected by these vulnerabilities. PHP considers the risk highest for mod_php, where the demonstrated exploit achieves unauthenticated remote code execution before application code runs. Both CVEs have been rated CVSS 9.2 (Critical) under CVSS v4.0 by PHP.
PHP handles out-of-memory (OOM) conditions, unwinding straight out of the current execution context and aborting the request. In certain early-request contexts, request-scoped memory is reachable before it has been fully initialized.
If any allocation fails in that window, the non-local exit skips the initialization and PHP’s error path does not account for the half-built state. The request shutdown routine then reads or branches on that memory. The failing allocation does not need to be related to the corrupted memory, so the trigger is generic: any OOM during the window is enough.
Several OOM-induction strategies trigger it consistently, which makes exploitation reliable and leads to Remote Code Execution (RCE).
PHP workers are long-lived and reused across requests and they keep some global state (error, session, object and extension data) that points to memory belonging to a single request. That state should be cleared before the request’s memory is freed. A fatal error can stop an operation before it cleans up.
Examples include running out of memory, hitting the execution time limit or a failed compile. A later warning during shutdown can also refill error state that was already cleared. The request’s memory is then freed while the worker still points to it, which is a use-after-free. When the same worker handles its next request, early steps that run before normal setup (input, configuration, session and error handling) can read, free or act on that stale pointer.
With a carefully crafted memory layout, an attacker can turn this into RCE, meaning they run their own code on the server. Exploitation takes two separate HTTP requests handled by the same worker: the first leaves stale state behind and the second uses it.
PHP2Shell encompasses two critical-severity vulnerabilities in one of the most widely deployed server-side runtimes on the internet. A patch has now been made available and we encourage all organizations to patch where possible.
Not every vulnerability warrants immediate attention; however, this one does. The characteristics, including the potential impact and the exploitability demand quick action.
PHP has released the following versions that have addressed the vulnerabilities: PHP 8.5.12, PHP 8.4.27, PHP 8.3.36 and PHP 8.2.35.
Source downloads are available on php.net. Linux distributions and LTS vendors received the patches in advance, so check your vendor for updated packages.
Patching alone does not fully mitigate the possibility of exploitation. Keep in mind exploitability and follow this recommended execution sequence to reduce the highest risks first:
PHP’s guidance is clear: the only complete solution is an update.
PHP has published specific interim measures that reduce exposure to confirmed attack paths. These mitigations are not equivalent to patching. They mitigate the risk of exploitation, but they do not eliminate it completely.
The multi-part rejection workaround remains valid as an additional layer for both CVEs. Rejecting requests whose Content-Type contains multipart/form-data at the web server, before they reach PHP, is still a strong stopgap. Cover all HTTP methods, not just POST (PHP 8.4+ parses multipart bodies on other methods) and apply it to every virtual host and default server that passes requests to PHP. This breaks file uploads until removed.
For CVE-2026-109618 (OOM corruption):
For CVE-2026-109619 (stale global state):
PHP 8.1 and earlier are end-of-life, so normally, those versions would not receive updates. Notably, PHP published minimal source-backports for PHP 7.4, 8.0 and 8.1 to help organizations building from source or without access to an LTS vendor. This is not a full-support commitment. However, it is a valuable lifeline for teams that can compile from source and need to close the gap.
For systems that can’t be patched or compiled from backports (and especially for anything older than 7.4) the guidance from multiple regulatory boards and industry experts stands: isolate internet-facing PHP systems from public networks or take them offline entirely. That’s a hard conversation for teams running legacy applications on unsupported PHP versions and it’s a conversation that needs to happen today.
With a widely available patch for supported versions and the lifeline thrown for some legacy code, threat actors will weaponize these exploits against unpatched and end of life systems.
Patching closes the door, which reduces your risk going forward. However, it doesn’t guarantee that a threat actor wasn’t able to slip through the cracks while you were busy patching. A retrospective threat hunt based on these behavior signals can help you eliminate the possibility of infiltration:
A clean result doesn’t rule out compromise, but it does indicate that the available behavioral indicators didn’t fire. That’s a meaningful data point. That said: preserve your logs. Web server and PHP logs from October 20th, 15:00 UTC onward are your forensic baseline. Log rotation, redeployment and container rebuilds can destroy the evidence needed for a compromise assessment. Back them up before patching changes anything.
GuidePoint Security’s GRIT team is actively tracking PHP2Shell and its impact. We will provide updated advisories, emerging exploit techniques and confirmed indicators of compromise as they become available. If PHP workers are spawning shells, unexpected files appear in web roots or you discover persistence mechanisms on a PHP host, the GuidePoint Security Incident Response team is ready to help.
PHP2Shell is the collective name for two critical PHP vulnerabilities (CVE-2026-109618 and CVE-2026-109619) disclosed on October 20, 2026. Both are rated CVSS 9.2 (Critical) and can allow unauthenticated remote code execution on PHP web servers. CVE-2026-109618 exploits out-of-memory corruption during request processing and CVE-2026-109619 exploits stale global state that persists across requests within the same PHP worker process.
All PHP installations serving web requests are affected, including PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed. PHP considers mod_php the highest-risk configuration. Patched versions are PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35. PHP 8.1 and earlier are end-of-life and will not receive official patches, though PHP published minimal source-backports for PHP 7.4, 8.0 and 8.1. Unconfirmed reports indicate the vulnerabilities may affect versions as far back as PHP 5.
Update to PHP 8.5.12, 8.4.27, 8.3.36 or 8.2.35. Source downloads are available on php.net and Linux distributions and LTS vendors received patches in advance. After updating, restart PHP-FPM, Apache modules and all long-running PHP processes such as queue workers and schedulers; these continue running the old binary until restarted. Container images must be rebuilt and redeployed with the patched PHP version. Confirm the fix through package changelogs or vendor advisories rather than version strings, since distributions often backport fixes without changing the upstream version number.
PHP’s official position is that only a full update is a complete solution. Interim measures that reduce exposure include: rejecting requests whose Content-Type contains multipart/form-data at the web server before they reach PHP (covering all HTTP methods, not just POST); setting memory_limit=-1 to remove the controllable OOM trigger for CVE-2026-109618; and setting session.upload_progress.enabled=0 for CVE-2026-109619. For systems running PHP 8.1 or earlier that cannot be patched or compiled from PHP’s source-backports, the recommended action is isolation from public networks or taking them offline.
As of October 21, 2026, no vendor-published indicators of compromise exist yet, so detection relies on behavioral hunting. Look for PHP worker processes spawning shells or download utilities, unexplained worker crashes or segmentation faults in PHP-FPM and web server logs, unusual multipart/form-data requests (especially to endpoints that don’t accept uploads) from October 20, 2026 onward, new or modified files in web roots and upload directories, changes to .user.ini files or auto_prepend_file settings and new persistence indicators such as cron entries, SSH authorized_keys additions or unexpected outbound connections. Preserve web server and PHP logs from October 20 onward before patching or redeploying.