What happened?
On 21 October 2026 the PHP project released an emergency security update for two critical flaws. Both allow an attacker to run their own code on the server remotely, without logging in. Together the two flaws are known as PHP2Shell.
The Hungarian National Cyber Security Institute (NBSZ NKI) issued an alert the same day, urging an immediate update and, where that is not possible, isolating or temporarily shutting down affected internet-facing systems. As a precaution, the Hungarian government temporarily took the magyarorszag.hu portal and several other government sites offline. No signs of an attack were found there.
What is the flaw?
Both flaws sit in PHP’s memory handling, in the runtime itself, not in the website’s own code.
CVE-2026-109618: if a request runs out of the memory PHP allows (memory_limit) at the wrong moment, processing can stop while the request’s internal data is only partly initialised. Cleanup may then treat that data as valid, which can corrupt memory and lead to code execution. Under Apache mod_php a single unauthenticated request can trigger it before any application code runs.CVE-2026-109619: after a fatal error, a request’s internal state can point to memory that has already been freed, and a later request on the same PHP worker can use it (use-after-free). This can leak memory contents and lead to code execution.
PHP rates both flaws 9.2 on CVSS v4.0, which is critical. The 10.0 score that circulated before disclosure is incorrect.
Who is affected?
Every PHP installation that serves web requests: PHP-FPM, Apache mod_php, php-cgi, FrankenPHP and LiteSpeed. PHP considers mod_php the highest risk. The affected code has been present since PHP 5.4.
That makes every system built on PHP affected too: WordPress and WooCommerce sites, Drupal, Joomla and Magento, Laravel and Symfony applications, and custom PHP software. Updating WordPress or its plugins does not fix the flaw, because it is in PHP. On shared hosting the PHP version comes from the hosting provider and can be checked in the control panel or with the provider.
| PHP branch | Fix |
|---|---|
| 8.5 | Fixed in 8.5.12 |
| 8.4 | Fixed in 8.4.27 |
| 8.3 | Fixed in 8.3.36 |
| 8.2 | Fixed in 8.2.35, support ends on 31 December 2026 |
| 8.1, 8.0, 7.4 | No official release: minimal source backports, or a Linux distribution or LTS vendor package |
| 7.3 and older | No fix, an upgrade to a supported version is needed |
What are the risks?
Remote code execution is one of the most severe classes of flaw: with the web server’s permissions, an attacker can do anything the website itself can.
- Data theft: customer data, orders, passwords and API keys can end up in the wrong hands.
- For web shops, silent changes to the payment page and theft of the card details entered there.
- Malicious code and redirects: visitors can be sent to infected pages, and browsers and Google can flag the site with a warning.
- Ransomware and downtime: earlier critical PHP flaws (such as
CVE-2024-4577) have been exploited in ransomware campaigns. - The server as a stepping stone: a compromised machine can be used to attack internal systems, send spam or mine cryptocurrency.
- Legal consequences: under the GDPR, a personal data breach must as a rule be reported to the supervisory authority within 72 hours.
Attacks have already started. Amazon’s threat intelligence saw an exploitation attempt on 17 October 2026, four days before disclosure, and Cloudflare and watchTowr have since reported attack attempts. Besides updating, it is worth checking whether a compromise has already happened.
What to do now?
Check the PHP version
The
php -vcommand on the server, the hosting control panel or the provider gives the version. The PHP used by the web server can differ from the command line one, so the web version is worth checking too, for example with a temporaryphpinfo()page that is deleted afterwards.Update to a fixed version
8.5.12,8.4.27,8.3.36or8.2.35, or the fixed package of the Linux distribution. Restart every PHP worker after the update; for containers, update the base image as well.Plan an upgrade for old versions
PHP 8.1 and older branches get no official fix. The answer is a distribution or LTS vendor fix, or an upgrade to a supported version with a compatibility check of the application.
Look for signs of compromise
Review the logs from 17 October: repeated HTTP 500 errors, PHP-FPM crashes (
SIGSEGV), commands started by the web server user, unknown files in/tmpand unusual outbound connections.
Temporary protection if the update is delayed
According to PHP and NBSZ NKI, the settings below reduce the risk but do not make a system safe. Only the update is a complete fix.
memory_limit = -1set so applications cannot override it (for examplephp_admin_value), a lowpost_max_sizewithupload_max_filesizebelow it, and a container or cgroup memory limit to protect the server.session.upload_progress.enabled = 0, on PHP 8.5 alsofatal_error_backtraces = 0, then a restart of every PHP worker.- Request size limits on the web server or proxy, and WAF rules (for example Cloudflare). These add protection, but the providers themselves call them temporary.
- If none of this is possible: isolate or temporarily shut down the affected internet-facing system, as NBSZ NKI recommends.

