← Insights

PHP2Shell: what two critical PHP flaws mean for Kenyan organizations

On 21 October 2026 the PHP project released emergency patches for two critical flaws that let an attacker run code on a web server without logging in. Kenya's government has told state agencies to treat it as urgent. If your website, portal or app runs PHP, this applies to you.

What happened

  • 17 October. Amazon Threat Intelligence saw an exploitation attempt on one of its honeypots, four days before public disclosure.
  • 20 October. The two CVE identifiers leaked on social media, and PHP announced an urgent security release.
  • 21 October. PHP released fixed versions: 8.5.12, 8.4.27, 8.3.36 and 8.2.35.

The flaws are CVE-2026-109618, memory corruption when PHP runs out of memory while handling a request, and CVE-2026-109619, a use-after-free where state left over from one request is reused by a later request on the same worker. Both are rated 9.2 (critical) on CVSS v4.0. Both can lead to unauthenticated remote code execution: code running on your server with the web worker's privileges.

As the NSA puts it, these are flaws in PHP itself, not in the hosted application or its configuration. Having a well-built website does not protect you.

Who has warned

  • NSA, 21 October. Says servers running affected PHP versions are exploitable, expects attackers to weaponize the flaws, and advises that if an immediate update is not feasible, organizations should take the system offline until it can be fully mitigated.
  • Kenya, State Department for ICT and the Digital Economy, with the ICT Authority. An advisory to all ministries, departments and agencies, rated critical. It tells institutions to identify PHP systems, prepare to apply the updates the moment they are released, restrict external access or take systems offline if they cannot be secured, review logs for signs of compromise, and report incidents through government channels.
  • FBI Cyber Division and CISA also issued alerts urging organizations to update.

Why this matters here

PHP runs a very large share of the web, including WordPress, Joomla, Drupal and Laravel applications and many government and business portals. Most small businesses sit on shared hosting where the provider controls the PHP version. Many sites run on old versions that nobody maintains. Each of these is a place the flaws can reach.

Which versions are affected

  • PHP 8.5, 8.4, 8.3 and 8.2: upgrade to 8.5.12, 8.4.27, 8.3.36 or 8.2.35 or later.
  • PHP 7.4 to 8.1: no routine upstream update. PHP published minimal source backports, and your Linux vendor may offer a patched package. Check before assuming you are covered.
  • PHP 7.3 and older: end of life, with no fix from PHP. Move to a supported release.
  • Every way of serving PHP is affected, including PHP-FPM, Apache mod_php, php-cgi, FrankenPHP and LiteSpeed. PHP considers mod_php the highest risk, because an attack can succeed before any of your application code runs.

PHP 8.2 reaches end of life on 31 December 2026, so plan your next upgrade now.

What to do today

  1. Find every place PHP runs. Web servers, containers, staging copies, client sites, and third-party products that bundle PHP.
  2. Check each version. Run php -v on the server. On WordPress, open Tools, then Site Health, then Info, then Server. Hosting control panels show the PHP version in their settings.
  3. Patch. Upgrade to a fixed release, or to a vendor package that contains both fixes, then restart your PHP workers.
  4. On shared or managed hosting, ask your provider in writing whether they have patched and on what date. Keep the reply.
  5. If you cannot patch today, reduce exposure with the measures below, and restrict access to the system or take it offline, as the NSA and Kenya's advisory recommend.
  6. Look for signs of compromise, starting from 17 October. Check web server logs for unusual or oversized multipart requests, files created or changed in web directories, unfamiliar processes and new admin users.
  7. Do not treat empty logs as an all-clear. Missing logs do not prove a system is safe.
  8. If you find a compromise, preserve logs and evidence, isolate the server and report it. Tell your hosting provider and the national incident response team, KE-CIRT/CC. Government bodies use the government reporting channels.

Temporary measures if you cannot patch yet

  • Set memory_limit=-1 at server level so applications cannot override it, then restart every PHP worker. This is for CVE-2026-109618.
  • Set session.upload_progress.enabled=0 in php.ini or your pool configuration, then restart. This is for CVE-2026-109619. Setting it inside application code or .user.ini is too late.
  • On PHP 8.5 only, set fatal_error_backtraces=0 and restart.
  • Limit request body size at your web server or proxy, and block multipart uploads entirely if the application does not need them.
  • Do not use RLIMIT_AS or RLIMIT_DATA. They can trigger the vulnerable code path.

These measures reduce exposure but do not fix the flaws. PHP says updating is the only complete fix. A web application firewall can help, but it only covers traffic that passes through it.

The lesson

You cannot patch what you have not listed. Organizations that already knew where PHP ran, and which version, spent 21 October patching. The rest spent it searching. A current inventory of your systems is the cheapest security control there is.

How Draorc can help

We offer a PHP exposure review under written scope and authorization: an inventory of where PHP runs, version and patch verification, a log review for signs of compromise since 17 October, and hardening of the web server layer.

Details are still changing. This article reflects information available on 22 October 2026. Check php.net for the latest version numbers and guidance.

Sources

Want to know whether your systems are exposed? We run short, authorized PHP exposure reviews for organizations in Kenya.

Contact Draorc →