<figure class="news-cover"><img src="https://aposhuang.com/uploads/covers/news-php2shell-2ecb3e26.jpg" alt="aposhuang.com | Security" loading="eager"><figcaption>aposhuang.com | Security</figcaption></figure><p>On October 21, 2026, the PHP project released 8.2.35, 8.3.36, 8.4.27 and 8.5.12, fixing two unauthenticated remote code execution flaws rated 9.2 under CVSS v4.0: CVE-2026-109618 and CVE-2026-109619, collectively dubbed "PHP2Shell". The score is not the interesting part. The timeline from vendor honeypots is. AWS recorded a first exploitation attempt on October 17 — four days before disclosure. Forty-four minutes after the advisory went up, payloads with exploit characteristics were hitting Deutsche Telekom's sensors.</p>
<h2>What was fixed</h2>
<p>Both bugs sit at the bottom of the request lifecycle: memory management and error handling.</p>
<p><strong>CVE-2026-109618</strong> (GHSA-w8hw-w9fx-j79w) lives in PHP's handling of out-of-memory conditions through longjmp(). Request memory is temporarily reachable before it is fully initialized. If an allocation fails in that window, PHP does not account for the early exit and leaves the request memory in an invalid state — and the failed allocation need not be related to the invalid memory. The request shutdown procedure then reads that state and branches on it. The advisory states that multiple OOM strategies trigger the condition consistently and lead to remote code execution. The weakness is CWE-416, use after free.</p>
<p><strong>CVE-2026-109619</strong> (GHSA-6wmf-4rv5-p3rp) is the other route. After a fatal error at the wrong moment, the worker's global state still points at memory owned by the previous request, which has already been freed. When the same worker handles the next request, it reads that dangling state before normal initialization replaces it. With a carefully arranged heap layout, full RCE follows.</p>
<p>Affected versions are every branch below 8.2.35, 8.3.36, 8.4.27 and 8.5.12 — in practice, almost every production install running today.</p>
<h2>Why this is not "just another PHP bug"</h2>
<p>The dividing line is Apache's mod_php. It invokes the request shutdown procedure even when request startup has failed, and multipart form parsing can exhaust memory_limit before a single line of application code runs. <strong>No login, no route reached, no framework code executed — the attack is already inside the broken path.</strong> PHP's own advisory confirms full remote code execution over HTTP against mod_php with default input and memory limits and ordinary prefork configurations.</p>
<p>PHP-FPM is somewhat better: when request startup fails, it kills the child, so the invalid state is never consumed. But after a normal startup, application-level input can still reach OOM, and the advisory therefore also lists FPM as exploitable through application-level code paths. WordPress, Drupal or your own framework cannot filter this out. The flaw is in the language runtime, not the application.</p>
<h2>Attackers were knocking four days early</h2>
<p>All times UTC.</p>
<p><strong>Oct 17</strong> — AWS MadPot recorded the first PHP2Shell exploitation attempt, from an IP on a commercial anonymization network, while the vulnerability was still under embargo. AWS's read: targeting a honeypot from an anonymized address during an embargo looks like a threat actor rather than a random scan, though how the actor obtained exploit information remains unclear.</p>
<p><strong>Oct 21, 02:00</strong> — public proof-of-concept code appears; further attempts follow between 02:00 and 08:00 from different anonymized infrastructure with different payloads, which AWS attributes to multiple actors.</p>
<p><strong>Oct 21, 13:34</strong> — the advisories go live.</p>
<p><strong>Oct 21, 14:18–15:51</strong> — Telekom's honeypots receive exploit-like serialized PHP payloads from a single source: 44 minutes after disclosure.</p>
<p><strong>Oct 21, from 15:34</strong> — at least ten different "php2shell"-themed User-Agents begin probing; most send nothing more than a GET.</p>
<p>On scale, Unit 42 cites Cortex Xpanse telemetry identifying roughly <strong>22.6 million exposed instances</strong> potentially vulnerable, and reports that at least one European government took its website offline as a precaution. Cloudflare says it observed attack traffic against customers; watchTowr and Hadrian reported attacks. CISA had not confirmed successful exploitation in the wild at that point. Hunt.io's honeypots were scanned about 20 minutes after the patch shipped but saw no confirmed compromises.</p>
<h2>Thirty seconds to find out whether you are exposed</h2>
<p><strong>Version:</strong> run <code>php -v</code> or <code>php -r 'echo PHP_VERSION;'</code>. Anything below the fixed release for your branch — 8.2.35, 8.3.36, 8.4.27, 8.5.12 — is affected.</p>
<p><strong>SAPI:</strong> run <code>php -r 'echo php_sapi_name();'</code>. <code>apache2handler</code> means mod_php, the worst configuration. <code>fpm-fcgi</code> means FPM: a step down, not zero.</p>
<p><strong>End-of-life branches:</strong> 7.4, 8.0 and 8.1 no longer receive official releases, but some distributions and hosts backported the fix — Clever Cloud shipped patched builds of 7.4.33, 8.0.30 and 8.1.34. Judge by your distribution's advisory, not by php.net's version table.</p>
<h2>What to do when you cannot upgrade</h2>
<p>While writing this I checked the two machines in front of me. On the shared host serving this site, the newest PHP versions selectable in the panel are 8.3.35, 8.4.26 and 8.5.11 — all below the fixed release. The other site, running WordPress, sits on 8.2.34. Two days after disclosure, both are still in the affected range. Not because the upgrade was forgotten, but because the host has not packaged 8.3.36 yet. That is probably the real situation for most people.</p>
<p>At this stage, four things in order of value:</p>
<p><strong>Move mod_php to PHP-FPM.</strong> It closes the "hit before application code runs" path directly, and it is the cheapest mitigation available without waiting for a vendor release.</p>
<p><strong>Put a WAF or virtual patch in front.</strong> Palo Alto's virtual patching covers both CVEs and Cloudflare has rules on its side. Neither stops every mutated request, but it beats running bare while you wait for a package.</p>
<p><strong>Watch the panel version.</strong> Switch the moment 8.3.36 appears, then verify with <code>php -v</code>. Panels report the setting, not the running handler, and a switch that silently did not apply is common.</p>
<p><strong>Do not console yourself with "it's a small site".</strong> Scanning is internet-wide and does not read your traffic numbers. Most of those 22.6 million instances are small, unmaintained sites.</p>
<h2>Do not download "php2shell" from GitHub</h2>
<p>AhnLab analysed the top 100 GitHub repositories matching "php2shell" as of 13:30 on October 22. Ninety-nine were related to the two CVEs, 96 were created on October 21, and creation peaked at 19 repositories in one hour. Defensive repositories appeared first, but attack PoCs collected most of the stars — alongside "mitigation scripts" that run with administrative privileges, contradictory claims about whether public PoCs work, and malicious repositories posing as PoCs.</p>
<p>If you want to verify the bugs, the official GHSAs and the PHP Foundation's write-up are enough. Do not clone a stranger's PoC, and never run a one-click mitigation script on a production server.</p>
<h2>If you suspect you were hit</h2>
<p>Search access logs for three shapes: multipart requests without a usable content-length, single parts carrying an unreasonable number of headers, and probes around session.upload_progress. Check whether FPM children restart unexpectedly, and look for files you did not put there — web shells tend to be small and obfuscated. Treat database passwords, API keys and deploy keys as leaked and rotate all of them. Start with any host still running mod_php.</p>
<h2>The editorial view</h2>
<p>What stings is not the 9.2. It is the sentence the PHP Foundation wrote in its own announcement that day: the months-long delay in fixing this was a "structural failure". A security team operating on consensus, short of people, facing several fix strategies that each carried a cost, could not decide.</p>
<p>Pull the timeline back and it gets clearer. In 2024 PHP underwent its first external security audit in years, organised by OSTIF and carried out by Quarkslab, funded by the Sovereign Tech Agency. While fixing another issue from that audit, a core developer found the first signs of the OOM problem. A potential exploit was theorised in 2024, but no concrete vector was found, and more clearly defined issues took priority. Two years later it became unauthenticated RCE on 22.6 million machines.</p>
<p>For anyone running PHP, the conclusion is unglamorous: the runtime is shared, and so is the risk. However carefully you audit your own code, it does not change how longjmp() handles memory exhaustion.</p>
<p class="src">Sources: <a href="https://github.com/php/php-src/security/advisories/GHSA-w8hw-w9fx-j79w" rel="nofollow noopener" target="_blank">GHSA-w8hw-w9fx-j79w (CVE-2026-109618)</a>, <a href="https://github.com/php/php-src/security/advisories/GHSA-6wmf-4rv5-p3rp" rel="nofollow noopener" target="_blank">GHSA-6wmf-4rv5-p3rp (CVE-2026-109619)</a>, <a href="https://thephp.foundation/blog/2026/10/21/todays-php-security-release-and-how-were-strengthening-php-security/" rel="nofollow noopener" target="_blank">The PHP Foundation (2026-10-21)</a>, <a href="https://unit42.paloaltonetworks.com/cve-2026-109618-cve-2026-109619/" rel="nofollow noopener" target="_blank">Unit 42 (2026-10-21)</a>, <a href="https://aws.amazon.com/blogs/security/amazon-threat-intelligence-identifies-php2shell-exploitation-prior-to-public-disclosure-in-madpot/" rel="nofollow noopener" target="_blank">AWS Security Blog (2026-10-21)</a>, <a href="https://github.security.telekom.com/2026/10/php2shell-honeypot-observations.html" rel="nofollow noopener" target="_blank">Telekom Security (2026-10-22)</a>, <a href="https://www.ahnlab.com/en/contents/content-center/36343" rel="nofollow noopener" target="_blank">AhnLab (2026-10-22)</a></p><aside class="tl-cta" style="margin:28px 0;padding:18px 20px;border-left:3px solid #38bdf8;background:#0d1526;border-radius:8px"><p style="margin:0 0 6px"><strong>在日の手続き・住まい・引っ越しの相談先</strong></p><p style="margin:0;color:#93a3c4">言語別に相談できる事業者をまとめています。<a href="/services" style="color:#38bdf8">相談先を見る →</a></p></aside>