← Back to blog

PHP2Shell (CVE-2026-109618, CVE-2026-109619): what is affected, and how do you stay protected until you update PHP?

2026-11-01 · Security research

On 21 October, PHP released emergency fixes for two critical vulnerabilities that have been dubbed PHP2Shell. Both allow unauthenticated remote code execution (RCE) and affect almost every PHP version that serves web requests, from 5.4 to 8.5. Details leaked before the official disclosure, and the first exploitation attempts were observed four days before the fixes shipped.

In this article: what is affected, how to check your servers quickly, what to configure if you cannot update today, and whether a WAF protects you.

The short answer

  • Update PHP to at least 8.5.12, 8.4.27, 8.3.36 or 8.2.35 and restart all PHP processes. Updating plugins does not help.
  • If you cannot update today: session.upload_progress.enabled = Off, a lower post_max_size and restricted access from the internet.
  • A WAF buys time, but it is not the fix. Cloudflare, F5 and others block known variants, and F5 BIG-IP itself is also vulnerable and must be updated.

1. What is PHP2Shell?

These are two memory-management bugs in PHP itself, not in a plugin or an application [1][2]:

CVE-2026-109618 CVE-2026-109619
What happens PHP runs out of memory while still preparing the request and, during cleanup, uses partially initialised data References to already freed memory remain after a request and can be used by another request handled by the same process
Impact Code execution Code execution, process memory disclosure
Requests One (mod_php) Two to the same process
CVSS 4.0 9.2 9.2

The key point: the attack happens before your application code even runs. That is why updating WordPress, Laravel or other plugins does not help here; you need to update PHP itself. The second vulnerability also leaks PHP process memory, which may contain passwords, session tokens and API keys.

The vulnerabilities were found and reported by researchers from Wiz, Calif.io, OpenAI and Quarkslab [1][2].

2. How did it unfold?

According to Qualys, only about 199,000 of the 156 million PHP installations it can see were updated in the first 12 hours, and 71% of them run unsupported PHP branches [4].

3. Is my website vulnerable?

If your website runs on PHP and the version is lower than the one listed in the table, yes [1][2].

PHP branch Fixed version Note
8.5 8.5.12
8.4 8.4.27
8.3 8.3.36
8.2 8.2.35
8.1, 8.0, 7.4 No official release Patch code only (backport) or a distribution / LTS vendor package
7.3 and older No fix Upgrade to a supported branch

Every way PHP serves web requests is affected: Apache mod_php, PHP-FPM, php-cgi, LiteSpeed, FrankenPHP. Apache mod_php is the most urgent, because the attack is simplest there. With PHP-FPM, success depends on the configuration, but that is no reason to wait [5].

How to check:

php -v                       # CLI version (may differ from the web server!)
php-fpm -v                   # FPM version

The most reliable method is to create a temporary page with phpinfo() or look at the X-Powered-By header, because the CLI and the web server may use different PHP builds. In Linux distribution packages (Debian, Ubuntu, RHEL), the fix is often backported without changing the version number, so check your distribution's security advisory, not just the number.

If your website is hosted with a provider, ask them directly whether PHP has been updated to a fixed version, and when.

4. What should you do now?

1. Update PHP

This is the only reliable fix. The PHP team states clearly that no setting fully removes the vulnerabilities [1][2]. After updating, restart all PHP processes (FPM, Apache); otherwise old processes will keep running the old version.

2. If you cannot update today

PHP recommends the following temporary settings. They must be set in php.ini, the FPM pool or the web server configuration, not via ini_set() or .user.ini [1][2]:

; CVE-2026-109619: disable session upload progress
; (recommended to keep it disabled after updating too, if you do not use it)
session.upload_progress.enabled = Off

; PHP 8.5 only
fatal_error_backtraces = Off

; CVE-2026-109618: reduce the request size
post_max_size = 8M            ; 32M if the site has file uploads
upload_max_filesize = 6M      ; less than post_max_size
expose_php = Off

In addition:

PHP also mentions memory_limit = -1 as a temporary mitigation for the first vulnerability, but it increases the risk of the server hanging when it runs out of memory, so only use it together with a cgroup limit.

3. Check whether you have been attacked

Attempts began on 17 October, so review your logs from that date onwards. Indicators mentioned by security researchers [5][6]:

If you see suspicious indicators, updating alone is not enough: rotate passwords and API keys that may have been in PHP memory, and check that no web shells were left on the server.

Need help with PHP2Shell?

We will check whether your servers and F5 BIG-IP are vulnerable, configure temporary WAF rules and review your logs from 17 October onwards.

Book a consultation

5. WAFs and F5 BIG-IP (K000163821, K000163878): are you protected?

Partly, and this is a good example of why a WAF buys you time, not a fix.

WAF What it does
Cloudflare (Free and paid plans) Seven managed rules since 21 October, default action Block. On the free plan they are enabled automatically; on paid plans, check that the "Cloudflare Managed Ruleset" is enabled. Server responses are inspected as well [3]
F5 BIG-IP Advanced WAF / ASM, F5 WAF for NGINX, F5 Distributed Cloud WAF Signatures 200103697 and 200204115 (CVE-2026-109618) and 200204113 (CVE-2026-109619) in the ASM-AttackSignatures_20261022_154742.im update or later; they only protect in Blocking mode [7]
AWS WAF Rules in the PHP managed rule group; the recommendation is to block multipart if you do not use it [9]
ModSecurity / Coraza with OWASP CRS There is no official CRS release with php2shell rules yet (the latest is v4.30.0, from 2 October). On 22 October, the main branch only gained blocking of the User-Agent used by public PoC tools, which is easy to bypass [11]. Other rules, such as blocking phpinfo() output, are still under discussion [12]. One researcher reports that CRS PL1 blocked known attempts [13], and commercial rule sets (e.g. Imunify360) block known requests [10]

Is F5 BIG-IP itself vulnerable?

Yes. The BIG-IP management interface (Configuration utility) and APM use PHP, so F5 has confirmed that the appliances themselves are vulnerable [7]:

Product Affected versions Fixed in Risk
BIG-IP APM (data plane, Access profile) 21.1.0; 17.5.0–17.5.1; 17.1.0–17.1.3 21.1.0.4; 17.5.1.11; 17.1.3.7 High, CVSS 8.1 – unauthenticated
BIG-IP, all modules (management interface) Same as above Same as above High, CVSS 7.5 – authenticated

Not affected: BIG-IQ, F5OS, BIG-IP Next, NGINX, F5 Distributed Cloud.

If you are still on 17.5.1.10 or 17.1.3.6, F5 also offers engineering hotfixes (Hotfix-BIGIP-17.5.1.10.0.37.35-ENG, Hotfix-BIGIP-17.1.3.6.0.9.20-ENG, from MyF5 Downloads). They do not go through full QA, so F5 provides them without warranty [7].

Does your scanner still report PHP 5.4.45 on BIG-IP 17.5.1.11?

That is expected. On fixed BIG-IP versions the PHP version number did not change: F5 backported both fixes into the PHP 5.4.45 build it ships. You can confirm the fix from the BIG-IP command line [7]:

php --version          # PHP 5.4.45 (cli) (built: Oct 23 2026 ...)
rpm -q php --changelog | grep CVE-2026-109618

Until you have updated, F5 recommends:

What else should you configure in BIG-IP Advanced WAF / ASM?

Beyond signatures, F5 suggests policy settings that reduce the attack surface but, in F5's own words, do not replace a PHP update [7]:

Why isn't a WAF enough?

6. Why aren't patches alone enough?

PHP2Shell illustrates three things that will recur with other vulnerabilities:

  1. Exploitation started before the fixes. No patching schedule protects against that.
  2. Even for those who updated on time, a new related vulnerability appeared two days later.
  3. Most organisations need days or weeks to update all of their servers.

Security therefore has to rest not on a single layer but on several layers that cover for each other:

We will describe how to build such an architecture in practice, with BIG-IP and Coraza examples, in a follow-up article. For more on what Cloudflare can do, see the article "Cloudflare WAF: nemokamas planas, taisyklės ir kada jo neužtenka" (in Lithuanian).

Frequently asked questions

Does updating WordPress plugins protect against PHP2Shell?

No. The vulnerabilities are in PHP itself, so you need to update the PHP version on the server (or ask your hosting provider to do it).

Does the Cloudflare free plan protect against PHP2Shell?

Since 21 October, Cloudflare has been blocking known attack variants on the free plan as well [3]. This reduces the risk but does not replace a PHP update: attackers modify their requests, and the server may also be reachable in a way that bypasses Cloudflare.

Is PHP-FPM vulnerable?

Yes, although exploitation is harder than with Apache mod_php and success depends on the configuration. You need to update in every case.

How do I know whether my PHP is already patched?

Check the version used by the web server (phpinfo()) and compare it with the table of fixed versions. If PHP comes from a Linux distribution package, check the distribution's security advisory: the fix may be backported without changing the version number.

What should I do if I run PHP 7.4 or older?

For the 7.4–8.1 branches there is only the patch code or distribution / LTS vendor packages; for 7.3 and older there is nothing. Until you move to a supported version, restrict access from the internet and apply the temporary settings from this article.

Sources

  1. PHP — GHSA-w8hw-w9fx-j79w (CVE-2026-109618)
  2. PHP — GHSA-6wmf-4rv5-p3rp (CVE-2026-109619)
  3. Cloudflare — Cloudflare deploys protections against php2shell vulnerability
  4. Qualys — PHP2Shell: Find, Mitigate, and Patch Now
  5. watchTowr — PHP2Shell FAQ
  6. SOCRadar — PHP2Shell (CVE-2026-109618 & CVE-2026-109619)
  7. F5 — K000163821: PHP vulnerabilities CVE-2026-109618 and CVE-2026-109619 (updated 2026-10-30)
  8. F5 — K000163878: PHP vulnerability CVE-2026-115560
  9. AWS — Using AWS WAF to apply mitigations for PHP2Shell
  10. Imunify360 — What Imunify360 Blocks and What Needs the PHP Update
  11. OWASP CRS — PR #4893 (php2shell PoC User-Agent)
  12. OWASP CRS — PR #4902 (953130)
  13. frehi.be — PHP2Shell: mitigating with CRS and AppArmor before the patch
  14. Astra — CVE-2026-115560
  15. AWS — Amazon threat intelligence identifies PHP2Shell exploitation prior to public disclosure in MadPot
  16. PHP — php.net announcement on CVE-2026-115560 (2026-10-23)

Need help with PHP2Shell or your WAF?

We will check your PHP servers and F5 BIG-IP, configure temporary WAF rules in Cloudflare, F5 or Coraza, and help you plan the update without downtime.

Book a consultation