Skip to main content
Web Security Guide

What Is the PHP2Shell Vulnerability? How to Protect Your Site from and Fix PHP Security Vulnerabilities (2026)

PHP2Shell is a pair of critical vulnerabilities in PHP, announced on 21 October 2026, that can lead to remote code execution without authentication. We explain, with sources, which versions are affected, what you need to do on your site and the temporary measures.

Author: Kasım TOKTAŞ · First published: · Updated:
Summarize this topicKSM Digital • Smart Content
30 SEC

Learn about the PHP2Shell vulnerability in short, clear terms.

30-Second Summary

PHP2Shell is the name given to two critical security vulnerabilities in PHP’s core (CVE-2026-109618 and CVE-2026-109619). Both score 9.2 on CVSS v4 and can lead to remote code execution without authentication. Because the flaw lies in the PHP engine itself rather than in application code, running an up-to-date WordPress, Joomla or Drupal does not protect you on its own. Fixes were released on 21 October 2026: 8.5.12, 8.4.27, 8.3.36 and 8.2.35; earlier versions are affected. First identify all sites and servers running PHP and find out the version; if it is old, update it or ask your hosting company to, and restart PHP processes after the update. PHP states that no configuration change closes the vulnerability completely; the only full fix is updating.

The situation is developing fast; this summary is based on sources read on 23 October 2026.

Informational cover for the PHP2Shell critical PHP security vulnerability

Quick answer

PHP2Shell is the name given to two critical security vulnerabilities in the core of PHP (CVE-2026-109618 and CVE-2026-109619). According to PHP's own advisories, both score 9.2 (critical) on the CVSS v4 scale and can lead to remote code execution, without authentication, with the privileges of the web server account. Fixes were released on 21 October 2026: 8.5.12, 8.4.27, 8.3.36 and 8.2.35. PHP states that no configuration change fully closes the vulnerability; the only complete fix is updating.

What should you do in three steps? (1) Identify all the sites and servers that run PHP, (2) find out the PHP version, (3) if the version is older than the fixed versions above, update or ask your hosting company to update; then restart the PHP processes.

An honest warning: the situation is developing fast. This article is based on sources we read on 23 October 2026; it is not enough on its own for your server and does not replace technical advice. We deliberately give no attack details, only protection information.

Go straight to your situation:

What is PHP2Shell?

PHP2Shell is two memory safety vulnerabilities in the PHP engine itself, not in a specific application. So even if an up-to-date WordPress, Joomla or Drupal runs on your site, that alone gives no protection: the vulnerability can be triggered before application code even comes into play. PHP's advisories sum up the impact like this: remote code execution and memory disclosure, without authentication, with the privileges of the process running the web.

PHP2Shell: two vulnerabilities
OpenWhat happens, in short?Score
CVE-2026-109618PHP cuts off a request in an out-of-memory (OOM) error. While the request data is half-prepared, the cleanup stage can trust this invalid data. The advisory's title: “Remote code execution via OOM corruption”.CVSS v4: 9.2 (critical)
CVE-2026-109619Old global state left in the memory of a finished request can be used by a later request that arrives at the same worker process. The advisory's title: “remote code execution via stale global state”.CVSS v4: 9.2 (critical)

Which PHP setups are at risk?

PHP's advisory states that an Apache mod_php setup has been confirmed to be affected by the vulnerability, FrankenPHP and LSAPI are most likely affected, and PHP-FPM is considered potentially affected according to a source code review. Help Net Security reports that every PHP setup serving web requests is in scope, with mod_php carrying the greatest risk.

Why is it so serious? According to Recorded Future, the session upload progress feature the vulnerability uses has existed since PHP 5.4.0 and is on by default. Wiz Research states that the vulnerability can exist even in an application as simple as “Hello World”. Memory disclosure alone can expose passwords, tokens and keys belonging to other requests.

Are there real attacks?

The information changed in the first days. According to Help Net Security, Amazon Threat Intelligence recorded an exploitation attempt on 17 October 2026, four days before the public announcement. watchTowr reports seeing exploitation in its honeypot network since 21 October 2026; Recorded Future reports that Patchstack received incident reports from hosting partners. There are also some publicly available proof-of-concept (PoC) repositories; Recorded Future states that their effectiveness varies and that it did not independently test some of them. So updating without waiting is recommended.

Source: PHP security advisory GHSA-w8hw-w9fx-j79w (CVE-2026-109618) (opens in a new tab) · PHP security advisory GHSA-6wmf-4rv5-p3rp (CVE-2026-109619) (opens in a new tab)

Which PHP versions are affected?

According to PHP's advisories and watchTowr's version table, the situation is as follows:

Impact by PHP branch
PHP branchAffectedWhat to do?
PHP 8.5Versions before 8.5.12Move to 8.5.12 or later
PHP 8.4Versions before 8.4.27Move to 8.4.27 or later
PHP 8.3Versions before 8.3.36Move to 8.3.36 or later
PHP 8.2Versions before 8.2.35Move to 8.2.35 or later
PHP 8.1, 8.0, 7.4 (out of support)All versions (watchTowr)Use the patched package from your distribution or long-term support provider, or apply the PHP team's minimal source patch; the best is to move to a supported branch
PHP 7.3 and older, PHP 5All versions (watchTowr)No fix; upgrading to a supported branch is the only way
The version number may look old but be patched. According to Help Net Security, Linux distributions and long-term support providers received the patches before the public announcement. In a distribution's package, PHP's number may stay the same even though the fix has been added; check your own distribution's security bulletin or your hosting company's statement. In this case the number alone can be misleading.

Does this vulnerability concern me?

  • Content management systems such as WordPress, Joomla and Drupal run on PHP; Wiz's demonstrations are on these three systems.
  • Custom PHP software, e-commerce, booking and panel software are also in scope if they run on PHP.
  • If you have a completely static HTML site and no PHP runs on the same account, you are not directly affected. This is our inference; the sources speak of systems that run PHP.
  • If you use shared hosting, updating the PHP on the server depends on the hosting company; you need to ask them about the situation.

Source: PHP security advisory GHSA-w8hw-w9fx-j79w (CVE-2026-109618) (opens in a new tab) · PHP security advisory GHSA-6wmf-4rv5-p3rp (CVE-2026-109619) (opens in a new tab) · UK NCSC: Critical security issue affecting PHP (opens in a new tab)

How do you find out your PHP version?

A system administrator checking the PHP version with the php -v command

First you need to know which PHP version is running. Start with the easiest:

  1. From your hosting panel: most panels have a “PHP version” or “PHP selector” section. The version your site uses is written there.
  2. In WordPress: the PHP version appears under Tools, Site Health, Info, Server.
  3. If you have SSH access: type php -v on the command line. Help Net Security's warning: the PHP serving the web may be a different program from the PHP on the command line; so looking at the web server's configuration or the phpinfo() output gives a more accurate result.
  4. A temporary phpinfo page: open it only briefly to find out the version and delete it as soon as you are done. This page gives away a lot of information about your server.
A false sense of security. The version not appearing in page headers does not mean the server is up to date. Hiding the version does not close the vulnerability; it only makes it harder to read directly.

If you want to test your own server, Help Net Security reports that Searchlight Cyber has released an open-source scanner called php2shell-scanner. Use such tools only on your own systems and after reviewing the source code; do not scan other people's systems without permission.

What should you do? Step by step

Server maintenance and a security update in a data centre

We have combined the priority order of the UK NCSC with general good practice:

  1. Take inventory. According to the NCSC, identify all PHP installations, starting with those exposed to the internet, and do not limit yourself to old versions. Include websites, panels, test sites and old forgotten sites.
  2. Take a backup. Back up your files and database. Especially when moving from PHP 7 to 8, old plugins or themes may not work; if possible, try first on a test copy.
  3. Update. On shared or managed hosting, switch to the patched version from the panel or ask the hosting company to do it. On a VPS or dedicated server, install your distribution's security updates with the package manager; according to Help Net Security, distributions received the patches in advance. If your distribution does not offer a patched package, you need to build PHP from source or move to a supported branch.
  4. Restart the processes. According to watchTowr, all PHP worker processes must be restarted after updating; otherwise the fix does not take effect. For Apache mod_php you need to restart Apache, for PHP-FPM the PHP-FPM service.
  5. Verify the version. Check with the methods above that the PHP version has really changed.
  6. Follow the update. The NCSC recommends following future updates as well. If your site includes third-party software or a ready-made service, follow their PHP updates too.
Is updating PHP enough? Because the vulnerabilities are in PHP itself, moving to the fixed version of PHP is the real solution. WordPress or plugin updates do not close this vulnerability; even so, keeping them up to date is necessary for general security.

Source: UK NCSC: Critical security issue affecting PHP (opens in a new tab)

If you can't update right away: temporary measures

First, know this: PHP says no configuration change fully closes the vulnerability. The following only reduce the risk; they act as a bridge until you update. After the settings are changed, the PHP workers must be restarted. These settings are taken from PHP's advisories; consult your system administrator for the server configuration.

Temporary measures from PHP's advisories
MeasureNote
session.upload_progress.enabled=0Turns off the session upload progress feature. PHP recommends keeping it off after patching too, if you do not need the feature. An application that uses an upload progress bar is affected.
fatal_error_backtraces=0 (PHP 8.5 only)A measure specific to PHP 8.5 for CVE-2026-109619. It does not close other stale-state paths.
Request size and input limitsKeeping post_max_size reasonable, and limiting max_input_nesting_level and the numbers of input variables, multipart parts, headers per part and uploads (CVE-2026-109618 advisory). Limiting request size at the front layer as well is also recommended.
Blocking multipart requestsIf your application does not use file uploads, blocking these requests at the front layer (reverse proxy or WAF) is a route recommended by the advisory.
WAF (e.g. Cloudflare)According to Help Net Security, Cloudflare rolled out WAF rules for known exploitation paths and offered them to all customers, including free ones. Recorded Future recommends restricting external access if there is a delay, WAF and request filtering, and making sure the server cannot be reached directly; it counts these not as a replacement for the patch but as temporary measures.
Restricting access or taking offlineThe NCSC says to consider restricting internet access if you cannot update, and taking the system offline if the measures cannot be applied either.
Measures do not replace the patch. The sources put different emphasis on WAF and setting changes; but none of them says these replace updating. Settings such as memory limits, if done wrongly, can break your site or consume server resources; on this, follow only PHP's advisories and your system administrator's guidance.

Source: PHP security advisory GHSA-w8hw-w9fx-j79w (CVE-2026-109618) (opens in a new tab) · PHP security advisory GHSA-6wmf-4rv5-p3rp (CVE-2026-109619) (opens in a new tab) · UK NCSC: Critical security issue affecting PHP (opens in a new tab)

How do you know you've been attacked?

An expert reviewing system security logs

According to Recorded Future, because the vulnerability operates below the application layer, application logs may carry very few traces. Even so, look for these signs:

  • Memory limit errors following unusual multipart requests (Wiz)
  • Repeated HTTP 500 responses (Wiz)
  • Unexpectedly large or corrupted PHPSESSID response cookies (Wiz)
  • Unexplained recycling of PHP worker processes (Wiz)
  • Unexpected PHP process crashes, PHP errors and command execution traces in web server, application and endpoint logs since 20 October 2026 (Recorded Future)

As a general good practice (not an item in the sources), also look for new .php files you do not recognize in upload folders or the site root, unexpected scheduled tasks and admin accounts you do not know.

If in doubt

  1. If possible, isolate the system from the network or restrict access; the NCSC recommends examining the system for backdoors.
  2. Start incident response; if necessary, turn to an expert cyber incident response team (NCSC).
  3. Renew passwords, API keys and tokens that may have been exposed (Recorded Future).
  4. Consider restoring from a clean backup and putting the system back live after updating PHP.

Source: UK NCSC: Critical security issue affecting PHP (opens in a new tab)

Developments and official warnings

  • PHP (21 October 2026): published the fixed versions and two security advisories. PHP's download page carries the warning “critical remote code execution vulnerabilities, update immediately”.
  • UK NCSC (21 October 2026, updated on 22 October): states that organizations using any version of PHP are affected and gives the priority order above.
  • Cybersecurity Directorate (21 October 2026, TR-26-1372): according to news reports, it announced that the PHP2Shell vulnerabilities carry high risk. Security scans were launched across Türkiye, starting with public institutions. The Directorate's recommendations are to review internet-facing systems, apply the published security updates immediately, restrict unnecessary external access and take additional protection measures on necessary services. According to the reports, checks on the e-Devlet Gateway found no problem that adversely affects service security.
Note. We did not read the Cybersecurity Directorate's announcement directly; we summarized it as far as it is reported in news sources. For details, check the announcement on the security notices page of the Directorate's website.

Source: UK NCSC: Critical security issue affecting PHP (opens in a new tab)

What not to do

  • Do not postpone the update. Do not rely only on a setting change or a WAF; PHP states that the only complete fix is updating.
  • Do not run proof-of-concept (PoC) or “fix” scripts you found on the internet on your live server. Recorded Future states that the effectiveness of some repositories varies and that some are based on an invalid assumption; unverified code can harm your server.
  • Do not click links in emails or messages that use “security update” as a pretext. Update only from your hosting panel or your distribution's official package source.
  • Do not be content with hiding the version information. Hiding the version does not close the vulnerability.
  • Do not leave a phpinfo page open. It gives away a lot of information about the server.
  • Do not forget to restart after updating. Old PHP processes that are still running may not be patched (watchTowr).

Frequently asked questions

What is PHP2Shell?

PHP2Shell is the name given to two critical security vulnerabilities in the core of PHP (CVE-2026-109618 and CVE-2026-109619). According to PHP's advisories, both score 9.2 on the CVSS v4 scale and can lead to remote code execution, without authentication, with the privileges of the web server account. Fixes were released on 21 October 2026.

Which PHP versions are affected?

According to PHP's advisories, all versions before 8.5.12, 8.4.27, 8.3.36 and 8.2.35 are affected. 8.1, 8.0 and 7.4 are out of support; watchTowr states that all of them are affected and that there is no fix for 7.3 and older versions or for PHP 5. The UK NCSC says that organizations using any version of PHP are affected.

I use PHP 7.4, 8.0 or 8.1; what should I do?

According to Help Net Security, the PHP team released minimal source patches for these three branches; they are for those who build from source or who do not have a long-term support provider. If your Linux distribution or long-term support provider offers a patched package, use it. The soundest route is to move to a supported PHP branch.

I use PHP 5 or 7.3; is there a fix?

According to watchTowr, there is no fix for 7.3 and older versions or for PHP 5; the only option is to upgrade to a supported branch. If upgrading is not immediately possible, you need to restrict the system's internet access, and if that is not possible either, take the system temporarily offline, as the NCSC recommends.

Is my WordPress site affected?

The vulnerabilities are in PHP itself, not in the application. Wiz Research demonstrated remote code execution without authentication on WordPress, Drupal and Joomla examples. So keeping WordPress and plugins up to date is not enough; the PHP version the site runs on must also move to the fixed version.

I use shared hosting; what should I do?

First look at your site's PHP version in your hosting panel. If the version is older than the fixed version, switch to a supported and patched version in the panel; if no patched version appears in the panel, ask your hosting company in writing when it will offer one. Updating on the server side and restarting the processes is the hosting company's responsibility.

I use Cloudflare; am I protected?

According to Help Net Security, Cloudflare rolled out WAF rules for known exploitation paths, and they are offered to all customers, including free plans. But PHP says no configuration change fully closes the vulnerability; a WAF is an extra layer and does not replace the patch. Also make sure your server cannot be reached directly, bypassing Cloudflare.

How do I know if I've been attacked?

According to Wiz's description, signs are memory limit errors after unusual multipart requests, repeated HTTP 500 responses, unexpectedly large or corrupted PHPSESSID cookies and unexplained PHP worker process recycling. Recorded Future recommends starting log review from 20 October 2026; because the vulnerability operates below the application layer, application logs may leave few traces.

Do I need to change passwords after updating?

Recorded Future states that memory disclosure can expose passwords, tokens, API keys and certificates belonging to other requests. If you suspect your server was attacked, start incident response and renew credentials that may have been exposed. If there is no suspicion, reviewing at least your admin and database passwords is a reasonable precaution.

My site is entirely static HTML; am I affected?

The sources speak of systems that run PHP. If no PHP runs on your site or on the same hosting account, you are not directly affected by this vulnerability; this is our inference, as the sources make no separate statement about static sites. If other sites running PHP are on the same server, ask your hosting company about its update status.

If you would like support with your website or software: for a new corporate site, see our web design service page; for custom software and automation, our custom software for companies page. KSM Digital is not a hosting provider or a security audit firm; this article is general information. For server updates and incident response, contact your hosting provider or an authorized system administrator.
Author: Kasım TOKTAŞFirst published: 23 October 2026Last updated: 23 October 2026

Need support with your website or software project?

Write your situation to us on WhatsApp and let us do a free preliminary assessment.

Free Status Analysis