PHP2Shell (CVE-2026-109618, CVE-2026-109619): what is affected, and how do you stay protected until you update PHP?
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 lowerpost_max_sizeand 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?
- 19 August – the first bug is found; PHP is notified on 24 August.
- 17 October – Amazon sees the first exploitation attempts in its honeypots, four days before the fixes [15].
- 20 October – details leak on social media; PHP publishes a pre-announcement and CERT-EU issues a warning.
- 21 October, 03:02 UTC – Cloudflare enables WAF rules for all customers, including the free plan [3].
- 21 October, 14:00 UTC – PHP releases the fixes. On the same day, honeypots record exploitation of both vulnerabilities.
- 23 October – PHP announces another related vulnerability (CVE-2026-115560) that the 21 October releases do not fix. There is no fix for it yet [16].
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:
- limit the request size on the web server or proxy and block
multipart/form-dataif the site has no file uploads; - PHP-FPM: if performance allows, set
pm.max_requests = 1(every request runs in a new process, so the second vulnerability no longer has a "next" request to abuse); - enforce the memory limit through a container / cgroup limit, not through
RLIMIT_AS; - eliminate errors that a visitor can trigger (fatal errors, timeouts), as well as
.htaccess/php_valuesettings that generate warnings; - anything you cannot update quickly should be taken off the internet (VPN, IP allowlisting) or isolated.
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]:
multipart/form-dataPOST requests containing aPHP_SESSION_UPLOAD_PROGRESSfield from unfamiliar addresses;- very long or unusual
PHPSESSIDcookies; - PHP memory-limit errors at the start of a request and bursts of 500 responses;
- new or modified
.phpfiles, unknown processes, outbound connections from the server.
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 consultation5. 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:
- creating
/etc/php.ini.d/K000163821.iniwith the settings recommended by PHP (memory_limit = -1,post_max_size = 8M,upload_max_filesize = 7M,session.upload_progress.enabled = 0) and restartinghttpd(on APM, alsohttpd_sam, which may terminate webtop sessions). The settings do not survive a TMOS upgrade, and in an HA group they must be repeated on every device; - closing the management interface to untrusted networks: set Port Lockdown on self IPs to Allow None or Allow Custom without port 443, and allow access to the management interface only from trusted addresses.
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]:
- if the application does not need file uploads, disallow
multipartcontent (Header-Based Content Profiles → Disallow); - limit the POST data length and the total request length (F5 recommends up to 8 MB, because the default WAF buffer is 10 MB);
- enable HTTP protocol compliance checks: limits on the number of parameters and headers, blocking of
malformed
multipartrequests, multipleContent-Lengthheaders, and chunked encoding combined withContent-Length; - if session upload progress is not used, block the
PHP_SESSION_UPLOAD_PROGRESSparameter (or the name set insession.upload_progress.name) with a regular expression that rejects all values; - switch the policy to Blocking, remove staging exceptions and make sure the server cannot be reached by bypassing BIG-IP.
Why isn't a WAF enough?
- Attackers modify their requests to evade the rules; Cloudflare is already seeing this and keeps updating its rules [3].
- A WAF only protects traffic that passes through it. If the server can also be reached directly (direct IP, another domain, the internal network), the WAF will not help.
- CVE-2026-115560 (23 October; F5 tracks it in K000163878 [8]) works even against
the updated PHP 8.5.12, and there is no fix yet: PHP promises one in the next regular release
[16]. It only affects applications that configure the
php_binaryorphp_serializesession serialisation handler and switch it tophpviaini_set()beforesession_start()[14][16]. The existing Cloudflare rule stops it as long as the defaultsession.upload_progress.namehas not been changed [3]. The mitigation is the same:session.upload_progress.enabled = Off.
6. Why aren't patches alone enough?
PHP2Shell illustrates three things that will recur with other vulnerabilities:
- Exploitation started before the fixes. No patching schedule protects against that.
- Even for those who updated on time, a new related vulnerability appeared two days later.
- 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:
- a cloud WAF (e.g. Cloudflare) – fast virtual patching and DDoS absorption;
- a WAF in front of the application (BIG-IP, Coraza) – rules tailored to your specific application, and protection if someone bypasses the cloud layer;
- egress filtering – even if RCE succeeds, the server cannot download malicious code or exfiltrate data;
- PHP and server hardening, segmentation and log monitoring.
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
- PHP — GHSA-w8hw-w9fx-j79w (CVE-2026-109618)
- PHP — GHSA-6wmf-4rv5-p3rp (CVE-2026-109619)
- Cloudflare — Cloudflare deploys protections against php2shell vulnerability
- Qualys — PHP2Shell: Find, Mitigate, and Patch Now
- watchTowr — PHP2Shell FAQ
- SOCRadar — PHP2Shell (CVE-2026-109618 & CVE-2026-109619)
- F5 — K000163821: PHP vulnerabilities CVE-2026-109618 and CVE-2026-109619 (updated 2026-10-30)
- F5 — K000163878: PHP vulnerability CVE-2026-115560
- AWS — Using AWS WAF to apply mitigations for PHP2Shell
- Imunify360 — What Imunify360 Blocks and What Needs the PHP Update
- OWASP CRS — PR #4893 (php2shell PoC User-Agent)
- OWASP CRS — PR #4902 (953130)
- frehi.be — PHP2Shell: mitigating with CRS and AppArmor before the patch
- Astra — CVE-2026-115560
- AWS — Amazon threat intelligence identifies PHP2Shell exploitation prior to public disclosure in MadPot
- PHP — php.net announcement on CVE-2026-115560 (2026-10-23)