Back to Blog
Legacy Modernization

PHP2Shell: what the October 2026 PHP flaws mean for your systems, and how to patch

5 min read
CTOs
IT managers
PHP teams

Update, 23 Oct: PHP has published a follow-up advisory for a separate, unlikely remote code execution issue, CVE-2026-115560, which affects only applications that switch session.serialize_handler to php at runtime with ini_set() while session upload progress is enabled. There is no fix release yet, as PHP will address it in the next regular bugfix release. Until then, PHP suggests setting session.upload_progress.enabled=0, the same mitigation listed on 21 Oct, so if you already applied it no further action is needed [7].

On 21 October 2026 the PHP project released emergency security updates for two critical flaws, tracked as CVE-2026-109618 and CVE-2026-109619 and widely called "php2shell". Both can let an attacker who has no login run their own code on a server running PHP. If your business runs anything built on PHP, from a website to an internal portal or a customer marketplace, this is a patch to treat as urgent.

What happened

PHP announced on 20 October that a security release was coming, and shipped it the next day in versions 8.5.12, 8.4.27, 8.3.36 and 8.2.35 [1][2]. The two flaws sit in parts of PHP that almost every web request touches.

  • CVE-2026-109618, "RCE via OOM corruption" (advisory GHSA-w8hw-w9fx-j79w). When a request hits PHP's memory limit at exactly the wrong moment, PHP can leave internal data half built and later treat it as valid, which corrupts memory [1][3].
  • CVE-2026-109619, "RCE via stale global state" (advisory GHSA-6wmf-4rv5-p3rp). After a fatal error, internal state can keep pointing at memory from a previous request. A later request handled by the same worker can then use that freed memory [1][4].
  • The PHP security team rates both 9.2 out of 10 (CVSS 4.0) [2]. On Apache with mod_php, a single unauthenticated request can trigger the first flaw before any of your own application code runs, and full remote code execution was shown with default settings [3]. Remote code execution was also confirmed on PHP-FPM through application code paths [3].

    On 21 October the US Cybersecurity and Infrastructure Security Agency urged organisations to patch immediately. At that time it had not seen the flaws being exploited [5]. CERT-EU noted the same day that technical details and early proof of concept code were circulating publicly, which makes attacks more likely [2]. CERT/CC published its own vulnerability note on 22 October [6].

    Who is affected

    According to the PHP project, every PHP installation that serves web requests is at risk [1]. That includes:

  • PHP-FPM
  • Apache with mod_php, which PHP considers the highest risk setup
  • php-cgi
  • other PHP application servers and web servers with built in PHP
  • Affected versions are PHP 8.5 before 8.5.12, 8.4 before 8.4.27, 8.3 before 8.3.36 and 8.2 before 8.2.35 [2][4]. PHP 8.1 and older are end of life and get no official release, so they stay exposed unless you apply a backport or upgrade [1].

    PHP is also built into a lot of other software. You may be running it inside a content system, an admin panel, a hosting control panel or a bought in product without knowing it [2][5].

    How to check if you are exposed

  • Make a list of every server, container and hosted service that might run PHP, including internal tools and third party products [5].
  • On each server, run php -v to see the command line version, and check the version your web server actually uses, for example with a protected phpinfo() page that you remove straight afterwards, or your hosting dashboard.
  • Compare the version with the fixed releases above. Anything older on 8.2 to 8.5, and anything on 8.1 or below, needs action.
  • Check container images and base images too. A patched server can still run an old PHP inside a container.
  • Look for warning signs: PHP worker processes starting shells or downloading tools [5].
  • How to patch

  • Update to PHP 8.5.12, 8.4.27, 8.3.36 or 8.2.35 [1]. If you install PHP from your Linux distribution or a long term support provider, use their updated packages, as they received the fixes in advance [1].
  • Restart PHP-FPM, Apache and any long running PHP workers, and rebuild and redeploy containers, so the new version is really the one running.
  • Start with internet facing systems [5].
  • If you are on PHP 8.1 or older, ask your support provider for a backport, or use the minimal source backports the PHP security team published for 7.4, 8.0 and 8.1 [1]. The lasting fix is to move to a supported version.
  • If you cannot patch straight away, government advisories suggest taking exposed PHP systems offline or isolating them until they are fixed. A web application firewall may help a little in the meantime, but only an update is a complete fix [1][2][5].
  • The bigger lesson

    Systems stuck on old PHP versions are the hardest to protect when a flaw like this lands, because there is no official patch to apply. If an older PHP application is holding your business back, a planned move to a supported, modern stack costs far less than an emergency. Souza Labs helps teams in the UAE, GCC and UK modernise legacy systems step by step. Book a free consult, or message us on WhatsApp at +971 585692165.

    Sources

  • PHP project, security advisory and release notes, 21 Oct 2026: https://www.php.net/archive/2026.php
  • CERT-EU, Security Advisory 2026-018, Critical Vulnerabilities in PHP, 21 Oct 2026: https://www.cert.europa.eu/publications/security-advisories/2026-018/
  • The PHP Foundation, Today's PHP Security Release, 21 Oct 2026: https://thephp.foundation/blog/2026/10/21/todays-php-security-release-and-how-were-strengthening-php-security/
  • PHP source advisory GHSA-6wmf-4rv5-p3rp, 21 Oct 2026: https://github.com/php/php-src/security/advisories/GHSA-6wmf-4rv5-p3rp
  • CISA, Critical Vulnerabilities in PHP Require Immediate Patching, 21 Oct 2026: https://www.cisa.gov/news-events/alerts/2026/10/21/critical-vulnerabilities-php-require-immediate-patching
  • CERT/CC, Vulnerability Note VU#763488, 22 Oct 2026: https://www.kb.cert.org/vuls/id/763488
  • PHP project, Informational advisory: Session upload progress, 23 Oct 2026: https://www.php.net/archive/2026.php