Sunday, December 6, 2026
Patch priority

How do you patch PHP2Shell, the exploited PHP flaws?

CISA added both flaws to its exploited list on October 26. The PHP project fixed four branches, and AlmaLinux now ships fixes for every stream, including retired ones.

A person in silhouette against multiple computer monitors displaying lines of code

Update PHP to 8.5.12, 8.4.27, 8.3.36 or 8.2.35, or install your distribution's fixed package, then restart Apache, PHP-FPM and every long-running worker. CISA added both PHP2Shell flaws to its exploited-vulnerabilities list on October 26. PHP 8.1 and older have no official release, so use your vendor's backport or a source patch.

Is PHP2Shell being exploited?

Yes, CISA added CVE-2026-109618 and CVE-2026-109619 to its Known Exploited Vulnerabilities catalog on October 26 and gave federal civilian agencies until October 29, The Register reports. The listing followed Adel Karimi, detection and response lead at Perplexity, who confirmed remote code execution against honeypot systems on October 24, The Hacker News says. His findings fit CVE-2026-109618. The Register says he found no sign that the second flaw was involved.

Attacks started earlier. Amazon Threat Intelligence saw an exploit attempt on October 17, four days before disclosure, according to Tenable, and recommends that investigations start from that date. CISA has not said which organizations were compromised.

Which PHP versions fix PHP2Shell?

The PHP project shipped PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35 on October 21. Both flaws are rated 9.2 and let an attacker run code on a web server without logging in. The announcement says there are no complete mitigations and updating is "the only safe choice."

PHP 8.2 support ends on December 31, 2026, so plan its replacement now. For PHP 7.4, 8.0 and 8.1 the project's security team published source patches for teams that compile PHP themselves. Versions 5.4 to 7.3 get nothing from the project, Tenable says. PHP sits under WordPress, Drupal, Joomla, Magento and Laravel, so updating the application does nothing. The fix has to reach the runtime in the server package, host or image.

Which Linux distributions have fixed PHP packages?

Ubuntu has fixed packages for 22.04 (php8.1 8.1.2-1ubuntu2.28), 24.04 (php8.3 8.3.6-0ubuntu0.24.04.13), 26.04 and 26.10. Ubuntu 20.04 and older get the fix only through Ubuntu Pro, which is free for up to five machines. A fixed package can carry what looks like an old version number, so Debian advises looking for the CVE number in the package changelog.

AlmaLinux's 21:15 UTC update on October 21 says patched packages are in production for every PHP stream on AlmaLinux 8, 9 and 10. That includes the retired php:7.2, the default on AlmaLinux 8, though AlmaLinux does not promise future fixes for retired streams. At the time of that post, Red Hat had released a fix only for php:7.4 on RHEL 8. Check Red Hat's advisories for your stream.

What about AWS, containers and hosting panels?

Amazon Linux has updated packages in commercial regions. Elastic Beanstalk released PHP platform v4.13.12 on October 21, and AWS targeted a follow-on release with the upstream fix for October 22. Environments with Managed Platform Updates get it at the next maintenance window, and the rest need a manual update. AWS says Lightsail instances cannot be patched in place, so they need new instances from the updated blueprints.

Rebuild and redeploy every container image that carries PHP. Chainguard published patched images on October 21. PHP from a control panel, host or third-party repository is that vendor's to fix, so ask for a date. CERT-EU said the Remi repository had nothing ready on October 21, so check its current state or use your distribution's packages. Cloudflare's firewall rules cover only traffic through Cloudflare, and its CTO, Dane Knecht, called them "a STOPGAP only."

What can you do if you cannot patch today?

Isolate the system from the internet if you can, because CERT-EU says these steps "do not make an installation safe." Set memory_limit=-1 where applications cannot override it, cap post_max_size at 8M (32M if you need uploads), set session.upload_progress.enabled=0, and set fatal_error_backtraces=0 on PHP 8.5. Avoid RLIMIT_AS and RLIMIT_DATA, which AlmaLinux says can trigger the bug.

What should IT teams do about PHP2Shell today?

Treat any unpatched internet-facing PHP server as possibly compromised.

  • List every server, image and hosted site that runs PHP, including vendor appliances. CERT-EU points to the NCSC-NL php2shell repository on GitHub for products that embed PHP.
  • Patch internet-facing Apache with mod_php first. CERT-EU says the demonstrated exploit needs one unauthenticated request.
  • Restart Apache, PHP-FPM and every long-running PHP worker after patching. Ubuntu notes applications typically need a restart to pick up the fix.
  • Check memory_limit and post_max_size against what each application needs. The fix adds a hard memory limit that ends the process when reached.
  • Search logs back to October 17. The Hacker News lists the signs: odd multipart uploads that end in memory-limit errors, runs of HTTP 500s, very large PHPSESSID cookies and PHP workers restarting for no clear reason. CISA also published a SIGMA detection rule.
  • Book the move off PHP 8.1 and older.

Updated November 14, 2026 with CISA's October 26 listing and AlmaLinux's production fixes. First published October 22, 2026. Related: Oracle's October patch: what to patch first and October 2026 Patch Tuesday priority.