PHP2Shell: critical holes in PHP

On Wednesday 21 October 2026 PHP released an emergency update that closes two critical security holes in the PHP engine itself. Together they are known as PHP2Shell, and they allow an attacker to run code on a web server without logging in. The details leaked the day before, and the first attacks were seen before the fix was ready.
The fault sits in PHP and not in the individual website. Every site built on PHP, for example WordPress, Drupal, Joomla and Magento, is therefore exposed until the server runs one of the fixed versions: 8.5.12, 8.4.27, 8.3.36 or 8.2.35.
Timeline
The researchers had known about the holes for more than two months, but the leak on 20 October forced PHP to bring the fix forward by a day. Times are Danish time (UTC+2).
| Time | What happened |
|---|---|
| 21 Oct, approx. 15:35 | PHP releases 8.5.12, 8.4.27, 8.3.36 and 8.2.35 with the fixes, around 25 minutes ahead of the announced time (mysites.guru) |
| 21 Oct, 09:43 | Cloudflare reports the first attacks, before the fix is out (Sansec) |
| 20 Oct | Details leak on social media, and watchTowr confirms the flaw can be used to run code. PHP announces an emergency update for the following day instead of the planned 22 October (Tenable) |
| 24 Aug | Wiz Research reports the vulnerabilities to PHP (Sansec) |
| 11 Aug | Security company Calif reports the first flaw to PHP (Sansec) |
| 1 Aug | Calif finds several ways to run code through PHP (Sansec) |
What are the vulnerabilities?
Both flaws concern how PHP clears memory between and during requests, and both score 9.2 out of 10 on the CVSS v4.0 severity scale.
| Vulnerability | What goes wrong | Consequence |
|---|---|---|
| CVE-2026-109618 | When PHP runs out of memory it can be interrupted while the data for a request is only half set up | Memory leak and code execution |
| CVE-2026-109619 | Data belonging to one request can linger after the memory has been freed, and a later request can use it | Code execution |
The serious part is that the attacker needs no login, and that the flaw does not depend on the website’s own code. According to Patchstack even a very simple PHP page can be exploited if it runs on a vulnerable version. Researchers have demonstrated attacks against the latest releases of WordPress, Drupal, Joomla and Magento.
Who is affected?
Every PHP installation that answers web requests is affected if it runs a version from before the fix. That holds regardless of setup: PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed. According to Wiz, who helped find the flaws, they go back as far as PHP 5.4.
| PHP version | Fixed in | Note |
|---|---|---|
| 8.5 | 8.5.12 | Latest version |
| 8.4 | 8.4.27 | Full support to the end of 2026 |
| 8.3 | 8.3.36 | Security fixes only |
| 8.2 | 8.2.35 | Loses security support 31 December 2026 |
| 8.1 and older | No official fix | Must be upgraded |
Versions and support dates are from Brandefense and ma.ttias.be. A few commercial vendors, for example Zend, have patched their own long term releases of older PHP.
Reactions
Authorities in Denmark and abroad are urging everyone to update immediately, and security companies expect a wave of attacks now that both the fix and the technical details are public.
- The Danish Agency for Societal Security issued a warning on Wednesday telling Danish organisations to install the update as quickly as possible (samsik.dk).
- DI Digital urges companies to check their web solutions and points out that under NIS2 companies must handle vulnerabilities and report significant incidents. CERT-EU, the cybersecurity centre for the EU institutions, has issued a warning as well (DI).
- The US NSA has, according to TV 2, asked organisations to be ready to update.
- watchTowr has seen attacks in practice through its network of decoy servers (watchTowr), and Sansec expects mass exploitation (Sansec).
One notable detail is that artificial intelligence played a part in finding the flaws. Google writes that its own AI model helped both to find the vulnerability and to test the fix (Google Cloud).
What should you do?
The only complete solution is to run a fixed version of PHP. After that, check whether your site was hit in the hours before the fix arrived.
- Check your PHP version. In WordPress you find it under Tools, Site Health, Info, Server. The version must be at least 8.5.12, 8.4.27, 8.3.36 or 8.2.35.
- On shared hosting the provider normally updates within your version. If you cannot see a fixed version, contact their support.
- On your own server, update the PHP packages and restart PHP-FPM or the web server, so the new version is actually the one running.
- On PHP 8.1 or older, move to at least 8.2, preferably 8.4 or 8.5, in your control panel. Test the site afterwards.
- Look for signs of a break in. Check for unknown administrator accounts and new .php files dated 20 and 21 October, especially in the uploads folder. Run a malware scan.
- Update CMS, plugins and themes after taking a backup. It does not close the PHP hole, but it reduces the other risks.
If you find signs of a break in, change the passwords for the administrator, the database and FTP, and contact your hosting provider straight away.
How we can help
A day like this separates the companies that know what they are running from the companies that have to go looking. If you are not sure which of the two you are, that is the real finding.
- We check what you are running. Send us your setup and you get a straight answer: which PHP version is live, whether you are covered, and whether anything looks tampered with.
- We take the updates off your desk. We host, monitor and support the systems we build, in the EU on T-Systems infrastructure in Germany. Patching is part of operations, not something you have to remember.
- Someone is accountable. Danish project management and a named contact, so there is a person to call when something breaks at 11pm rather than a ticket queue.
- Stuck on an old platform? If you are running a CMS nobody dares to touch, we will map what needs updating, what should be rebuilt, and what can safely be left alone.
Read how we work with security day to day, see what we build in custom systems, or book a meeting and we will go through your setup with you.
Sources: mysites.guru, Sansec, Tenable, watchTowr, Patchstack, Wiz Research, Brandefense, ma.ttias.be, Google Cloud, samsik.dk, DI Digital and TV 2.