PHP2Shell: two critical vulnerabilities in PHP itself, not in a plugin. What to do now
by Claudiu Hulea · IT Management Consultant
Critical vulnerabilities in the web ecosystem are usually in a plugin, a theme or a specific application. PHP2Shell is different: the two vulnerabilities are in PHP itself, the engine WordPress, Magento, PrestaShop and a large part of the web run on. And one of them can be triggered before the application gets to run a single line of code.
PHP published the fixes on 21 October 2026, after a turbulent week, and exploitation attempts were observed the same day.
What happened
The vulnerabilities were reported in August by several researchers, independently (Calif and OpenAI, then Wiz, with additional vectors). On 20 October, their existence leaked publicly, with the CVE identifiers and the disclosure date, but without technical details. The same day, PHP announced the release of the fixes for 21 October at 14:00 UTC.
The embargo broke on several fronts: a video of a working demonstration was published by mistake, and built images containing the fix appeared a few hours before the release. On 21 October, several security vendors (watchTowr, Hadrian, Cloudflare and others) reported exploitation attempts, some even before the patch. At the time of writing, no source had confirmed a successful compromise, and the vulnerabilities were not in CISA’s Known Exploited Vulnerabilities catalog. But the window is clearly open.
The two vulnerabilities, briefly
- CVE-2026-109618, corruption on out-of-memory. A specially built upload request (for example, a huge number of headers or many empty file fields, within normal limits) forces PHP to run out of memory exactly when the request’s internal data is only partially initialized. PHP confirmed remote code execution over HTTP on
mod_php, with default limits, before the application code runs. - CVE-2026-109619, stale global state. Data owned by one request can survive after its memory has been freed and is reused by the next request handled by the same process. Two paths were confirmed: warnings generated by per-directory or per-request settings (
.htaccess,PHP_VALUE) and the session upload progress mechanism, enabled by default even if the application does not use sessions.
Both are rated 9.2 (CVSS v4.0) by PHP. The confirmed impact: code execution with the rights of the account PHP runs under. Researchers also note that process memory can be read, including credentials, tokens and API keys, even without obtaining code execution.
Who is exposed
PHP says the risk concerns all PHP installations serving web requests: PHP-FPM, mod_php, php-cgi, FrankenPHP, LiteSpeed. The risk is highest for mod_php, where both vulnerabilities were confirmed exploitable without depending on the application. On PHP-FPM, the second vulnerability was confirmed exploitable, but it depends on the application.
The fixed versions are 8.5.12, 8.4.27, 8.3.36 and 8.2.35. For 8.1 and older, PHP no longer releases official updates: it published only minimal source backports for 7.4, 8.0 and 8.1, and there is no fix at all for PHP 5. Researchers say the vulnerabilities go back as far as PHP 5.4; PHP has not officially confirmed the lower bound. An estimate cited in the press counts roughly 884,000 servers publicly reporting PHP 8.1 or older.
The trap: updating WordPress does not update PHP
It is the most common confusion we see. An up-to-date WordPress, Magento or PrestaShop site can run on a vulnerable PHP, because the engine and the application are updated separately. A few typical situations:
- shared hosting or a control panel (cPanel, Plesk): the PHP version is chosen and updated by the provider. Ask them explicitly which version you run and whether the patch is applied;
- Linux distributions: packages are often fixed through backports, so the version number can look old even though the patch is applied. Do not rely on
php -v; check the package history for the two CVEs; - forgotten servers: a test site, an old campaign page, an internal panel. Even a “Hello World” PHP page is enough for an attack.
What to do now, in order
- Take inventory. Where PHP runs in your environment, which version and in which mode (
mod_phpor FPM). Include forgotten servers and those run by providers. - Update. To 8.5.12, 8.4.27, 8.3.36 or 8.2.35, or to your distribution’s packages that mention the two CVEs. On shared hosting, get confirmation from the provider.
- If you cannot update right away, reduce exposure, knowing it is not a complete fix:
- set
session.upload_progress.enabled = 0in the server or FPM pool configuration and restart all processes. It blocks the confirmed session paths of CVE-2026-109619, but does nothing for CVE-2026-109618; - set low upload limits (
post_max_size) and enforce limits at the web server or proxy level too; - enable WAF rules if you have them; Cloudflare, for example, made them available to all customers;
- for whatever cannot be fixed, consider taking it offline temporarily, as the UK NCSC also recommends.
- set
- After patching, review memory limits. The fix introduces a hard limit, and hitting it stops the process, so
memory_limitandpost_max_sizeneed a review.
Check whether you were already hit
Because attempts started before the patch, updating is not the end. Look in the logs and on the server for:
- unusual multipart requests followed by memory-limit errors or repeated HTTP 500 responses;
- unusually large session cookies (
PHPSESSID) in responses; - unexplained restarts of PHP processes;
- PHP or web server processes launching shells, interpreters or download tools;
- new files in web directories (web shells), new cron jobs, new accounts.
If you find signs, preserve the logs before any cleanup and rotate the secrets on the server: database passwords, API keys, tokens. Process memory could be read even without code execution.
What we take away
PHP2Shell is not yet another plugin vulnerability, but one in the engine beneath the applications. The practical lesson is simple: updating the application and updating the platform it runs on are two different things, and both have to be tracked. Whoever has a clear inventory of servers, versions and hosting providers can close such a window in a few hours. Whoever does not discovers it only when they go looking.
Do you run shops or sites on PHP and want to know quickly what is exposed and what needs updating? Contact us and we start from an inventory.
Sources
- PHP: security announcement and versions 8.5.12, 8.4.27, 8.3.36, 8.2.35
- AlmaLinux: PHP packages fixed for CVE-2026-109618 and CVE-2026-109619
- The Hacker News: PHP issues emergency patches
- SecurityWeek: patches land as first exploitation attempts hit sensors
- watchTowr: PHP2Shell FAQ
- Help Net Security: PHP2Shell vulnerabilities patched
Frequently asked questions
What is PHP2Shell?
The name given to two critical vulnerabilities in PHP: CVE-2026-109618 (state corruption on out-of-memory) and CVE-2026-109619 (global state left behind after memory is freed). Both are rated 9.2 (CVSS v4.0) by PHP and can allow unauthenticated remote code execution on any PHP installation serving web requests.
Which versions are fixed?
PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35, released on 21 October 2026. Versions 8.1 and older no longer receive official updates; PHP published only minimal source backports for 7.4, 8.0 and 8.1, and Linux distributions and extended-support vendors received the patches in advance.
I updated WordPress. Am I protected?
No. The vulnerabilities are in PHP, the engine WordPress, Magento or PrestaShop runs on, not in the application. Updating the application does not update PHP. On shared hosting, ask your provider which PHP version you run and whether the patch is applied.
What do I do if I cannot update right away?
Temporary measures only reduce some attack paths. Disabling session.upload_progress.enabled blocks the confirmed session paths of CVE-2026-109619, but does nothing for CVE-2026-109618. Upload limits and a WAF help. PHP is clear that the only complete fix is updating.