Our Blog Development PHP2Shell: PHP Security Fixes for WordPress Websites

PHP2Shell: PHP Security Fixes for WordPress Websites

PHP2Shell security update: patched PHP versions, attack attempts, CVE-2026-115560 and Cloudflare and AWS WAF guidance for WordPress website owners.

PHP2Shell: PHP Security Fixes for WordPress Websites

PHP2Shell is the name for two critical PHP security vulnerabilities, CVE-2026-109618 and CVE-2026-109619, that can allow an attacker to run code on a server without logging in. WordPress and WooCommerce run on PHP, so website owners should confirm their host has installed a patched PHP build. Updating WordPress itself will not fix these server vulnerabilities.

Last reviewed: 26 October 2026 (AEST). Status: PHP2Shell fixes are available and attack attempts are being reported. A separate issue, CVE-2026-115560, still requires a configuration check and temporary mitigation while its upstream fix is pending.

Latest PHP2Shell security update: 26 October 2026

  • Fixed versions released: PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35 were released on 21 October 2026 at 14:00 UTC (midnight on 22 October in Queensland).
  • Who is at risk: PHP says all PHP installations serving web requests are at risk, including PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed.
  • Highest risk: Apache with mod_php. PHP has demonstrated unauthenticated exploitation before any website code runs. Risk and exploit reliability vary with the PHP build, configuration and application.
  • Older versions: PHP 8.1 and older get no official updates, but the PHP team has published minimal source fixes for PHP 7.4, 8.0 and 8.1 because of the severity. Some Linux distributions and long-term support vendors also provide fixes.
  • Attack activity: Amazon has reported an exploitation attempt from 17 October and broad exploitation attempts after disclosure. Cloudflare has also observed attack traffic and changing payloads. The earlier pre-release advice that exploitation was not known is no longer current.

The official announcement is on PHP.net, with full technical details in the two GitHub security advisories linked below.

What is PHP2Shell? CVE-2026-109618 and CVE-2026-109619

Both are remote code execution flaws in PHP itself. In plain terms, a specially crafted web request could let an attacker run their own code on your server.

  • CVE-2026-109618: RCE via out-of-memory corruption. If PHP runs out of memory at the wrong moment, it can be interrupted while internal request data is only half set up. The clean-up step can then treat that broken data as valid.
  • CVE-2026-109619: RCE via stale global state. Some internal data belonging to a request can survive after its memory has been freed. A later request handled by the same PHP worker can then use that leftover data before PHP resets it.

The important distinction is that these are PHP vulnerabilities, not WordPress plugin or theme vulnerabilities. Updating WordPress or a plugin does not patch the PHP runtime. Application code and server configuration can affect exploitability, but the fix is a patched PHP build on your server.

How PHP2Shell affects WordPress security

Yes. Every WordPress site runs on PHP, and PHP says all installations serving web requests are at risk, regardless of how PHP is connected to the web server.

Sites on Apache with mod_php are at the highest risk, because demonstrated attacks can happen before WordPress has loaded. PHP-FPM terminates workers on certain startup failures, which blocks those specific attack sequences. It remains susceptible through other paths, including application-dependent session handling. PHP also lists php-cgi, FrankenPHP and LiteSpeed as at risk. A different handler is not a substitute for patching.

The first step is to find out which PHP version your site uses and confirm your host has installed the patched build.

Which patched PHP versions fix PHP2Shell?

  • PHP 8.5 should be updated to 8.5.12 or later.
  • PHP 8.4 should be updated to 8.4.27 or later.
  • PHP 8.3 should be updated to 8.3.36 or later.
  • PHP 8.2 should be updated to 8.2.35 or later.
  • PHP 8.1, 8.0, 7.4 and older receive no official releases. Ask your vendor about backported fixes, or move to a supported version.

As of 26 October 2026, PHP lists 8.5.12, 8.4.27, 8.3.36 and 8.2.35 as its current stable releases and PHP2Shell fixes. Earlier builds in those branches are affected unless the vendor has backported the patches. These releases do not fix the separate CVE-2026-115560 issue described below. PHP 8.6 release candidates are testing builds and should not be used in production.

Linux distributions and long-term support vendors can backport fixes while retaining an older-looking PHP version number. Check the vendor’s exact package revision and advisory. For example, Ubuntu confirms fixes for its supported releases. Ask your host to verify each web-serving PHP handler and restart its workers, rather than relying on a command-line version check alone.

Looking further ahead, PHP 8.2 reaches the end of upstream security support on 31 December 2026, so plan for PHP 8.3 or newer. See the official PHP supported versions schedule.

CVE-2026-115560: a separate PHP session upload progress issue

On 23 October, PHP disclosed another possible remote code execution issue, CVE-2026-115560. Unlike the original PHP2Shell memory-safety flaws, it depends on an unusual combination of session configuration and application code. Installing the 21 October PHP2Shell releases does not resolve it.

The application must start with session.serialize_handler set to php_binary or php_serialize, then change it to php using ini_set() before calling session_start(). Session upload progress must also remain enabled. PHP says applications that never change the serialisation handler at runtime can keep the feature enabled.

PHP recommends setting session.upload_progress.enabled=0 until its next regular bugfix release. Apply this in startup configuration and restart all PHP workers. If you already disabled it for PHP2Shell, keep it disabled. As of this review, the upstream fix and full advisory are planned for that regular release, rather than another emergency release. See PHP’s 23 October advisory.

Is PHP2Shell being actively exploited? Scanning and attack attempts

Yes, exploitation attempts are being observed. Amazon Threat Intelligence traced an attempt in its MadPot honeypots to 17 October 2026, before public disclosure. It subsequently saw multiple actors and broad attempts after release. Amazon also cautioned that it was unclear whether the observed attempts would have succeeded against real-world systems. Scanning or a blocked request does not, by itself, confirm a successful compromise.

Review retained web server, PHP, WAF and system logs from at least 17 October. Investigate suspicious multipart POST requests, the PHP_SESSION_UPLOAD_PROGRESS field, unexpected process execution and changed website files. Treat indicators as investigation leads. Patching does not remove an existing web shell or undo a compromise. Amazon’s report: https://aws.amazon.com/blogs/security/amazon-threat-intelligence-identifies-php2shell-exploitation-prior-to-public-disclosure-in-madpot/.

How to check your PHP version in WordPress

You can find the PHP version reported by WordPress in your dashboard:

  1. Log in to your WordPress dashboard.
  2. Go to Tools → Site Health.
  3. Select Info and expand Server.
  4. Find the PHP version entry and compare it with the fixed versions above.

If your host uses distribution packages, the version shown may not match the list above even when the fix is installed. Your host should be able to confirm the patched package or build.

What WordPress website owners should do now

1Update PHP or ask your host to

If your host manages PHP, ask them to confirm the patched version or package is installed on your server. If you manage your own server, install the updated PHP packages from your distribution or vendor today.

After updating, restart PHP-FPM, Apache or LiteSpeed. Running PHP workers keep using the old code until they are restarted, so an update without a restart leaves the site exposed.

2Replace unsupported PHP versions

PHP 7.4, 8.0 and 8.1 are no longer supported by the PHP project. The emergency source fixes for these versions are a stopgap for people building PHP themselves, not a long-term solution.

If your website still uses one of these versions, schedule a move to PHP 8.3 or newer. Test the upgrade on a staging website first, especially if you rely on older plugins or custom code.

3Back up your site and check compatibility

Take a recent off-server backup of the files and database before any PHP change.

Minor security releases such as 8.3.36 rarely break anything. Moving between major versions, such as 8.1 to 8.3, is where plugin and theme problems show up. After any change, test forms, checkout, search, login and integrations.

4Apply temporary protections if you cannot update today

If an update is delayed, PHP has published settings that reduce some attack paths. They do not make a server safe and should only bridge the gap until the update is installed. The details are below.

Temporary mitigations for server administrators

These measures are from the official PHP advisory. They need server-level access, so most website owners should ask their host rather than change them directly.

For CVE-2026-109618 (out-of-memory corruption)

  • Set memory_limit=-1 in a way applications cannot override, such as php_admin_value in the FPM pool or Apache configuration. Check that no pool, directory or application setting puts a finite limit back. This removes the controllable memory limit failure, but an underlying allocation failure can still reach the vulnerable code.
  • Set a low post_max_size: 8M for sites that do not need file uploads, or 32M if uploads are needed. Keep upload_max_filesize below post_max_size.
  • Consider enforcing limits at the web server or proxy for request size, input field count, multipart part count, header count and nesting depth, including requests without a usable Content-Length.
  • Use a container or cgroup memory limit as a safety boundary, ideally one that kills only the affected worker. Do not use RLIMIT_AS or RLIMIT_DATA instead, as these can trigger the vulnerable allocation failure.

Note that memory_limit=-1 removes a safety net against runaway scripts, so pair it with a container or cgroup limit and remove it once PHP is updated.

For CVE-2026-109619 (stale global state)

  • Set session.upload_progress.enabled=0 in php.ini, the FPM pool or server configuration, then restart every worker. Do not rely on ini_set() or .user.ini. This blocks the confirmed session paths but not other variants.
  • On PHP 8.5, set fatal_error_backtraces=0 and restart every worker. This blocks the confirmed fatal error backtrace path only.
  • Remove invalid or deprecated settings applied per request that produce warnings before PHP finishes starting up. Hiding warnings with error_reporting, display_errors or @ does not help.
  • Fix fatal errors and execution timeouts that an attacker could trigger, including in callbacks, upload or import processing and clean-up code.

Will Wordfence or another security plugin protect my site?

Not against this. A WordPress security plugin only runs once WordPress has loaded, and PHP has shown the mod_php attack can happen before any website code runs. The plugin never gets a chance to see the request.

A firewall in front of the server, such as Cloudflare or a host-level WAF, may block some attack patterns as they become known. That is a useful extra layer, but it is not a substitute for installing the PHP update.

Cloudflare WAF protection for PHP2Shell and CVE-2026-115560

Cloudflare deployed PHP2Shell protections by default for customers using its Free or paid WAF from 21 October at 03:02 UTC. It has observed attack traffic and attackers altering payloads to try to bypass those protections. Confirm your site’s traffic passes through Cloudflare, review security events and any rule exceptions, and check paid Managed Ruleset deployments are in block mode.

Cloudflare says its existing PHP Remote Code Execution Attack #6 rule also protects against known CVE-2026-115560 attempts only when PHP uses the default upload progress field name. Sites that changed session.upload_progress.name are not covered by that rule. Keep the server-side mitigation in place and patch PHP. Guidance: https://blog.cloudflare.com/php-vulnerabilities-waf-protection/.

AWS WAF protection: update the PHP managed rule group

Enable AWSManagedRulesPHPRuleSet on the web ACL protecting each PHP application. Version 2.3 introduced PHP2Shell_BODY for CVE-2026-109619; version 2.4 added PHP2Shell_BODY_Extended for CVE-2026-109618. The AWS changelog now lists version 2.5 with improved Extended signatures. Use the current default version, or update a pinned version to the latest available release, and confirm the rules are blocking rather than overridden to Count.

AWS says PHP2Shell_BODY in version 2.4 and later also helps mitigate CVE-2026-115560 by blocking POST requests carrying a PHP session ID and the upload progress field. Do not assume a WordPress-specific rule group alone supplies the PHP rules. Review request body inspection limits and oversize handling, and test legitimate uploads and checkout after rule changes. WAF rules reduce exposure; they cannot fix vulnerable PHP memory handling or every server-side attack path.

AWS guidance: https://aws.amazon.com/blogs/security/using-aws-waf-to-apply-mitigations-for-php2shell-rce-vulnerabilities-cve-2026-109618-and-cve-2026-109619/. Latest rule versions: https://docs.aws.amazon.com/waf/latest/developerguide/aws-managed-rule-groups-changelog.html.

Frequently asked questions

Do I need to update WordPress as well as PHP?

Keep WordPress, plugins and themes updated as normal, but they will not fix this. Your hosting provider or server administrator must install the patched PHP version.

My host uses PHP-FPM. Am I safe?

No. PHP lists PHP-FPM as at risk. Apache with mod_php carries the highest risk, but every setup that serves web requests needs the update.

Is PHP 8.1 or PHP 7.4 affected?

Yes, these versions should be treated as affected. They get no official releases, although the PHP team has published minimal source fixes for 7.4, 8.0 and 8.1. Unless your host or vendor confirms a backported fix, upgrade to a supported version.

Can I update PHP from the WordPress dashboard?

No. PHP is controlled through your hosting account or server configuration, not WordPress’s updater. Some hosting control panels let you switch PHP versions, but the patched build still has to be installed by the host.

Are websites already being attacked?

Yes. Amazon and Cloudflare have reported exploitation attempts, including activity before public disclosure. Attempts and scanning do not prove every targeted site was compromised. Patch promptly and investigate suspicious activity, even if the site now runs a fixed PHP version.

Need help updating PHP or securing WordPress?

Thrive Digital provides WordPress hosting, website maintenance and technical support.

If you are unsure whether your site has been patched, or you need help moving off an old PHP version, contact our team.

You can also read our earlier guide to WordPress core security updates.

Security advisory update history

  • 26 October 2026: Rechecked current PHP2Shell fixes and server configurations. Added pre-disclosure attack reporting, CVE-2026-115560 and its mitigation, Cloudflare coverage limits, and current AWS WAF rule guidance. Updated the headline and WordPress security guidance.
  • 22 October 2026: PHP released 8.5.12, 8.4.27, 8.3.36 and 8.2.35. Added fixed versions, affected setups, technical summaries and temporary mitigations.
  • 21 October 2026 (afternoon): Added ASD’s ACSC pre-release alert. At that time the alert did not report known active exploitation; later vendor reporting supersedes that status.
  • 21 October 2026: Initial advisory prepared. Two critical PHP vulnerabilities announced; affected and fixed versions pending.

Sources: PHP security advisory and release announcements; GHSA-w8hw-w9fx-j79w (CVE-2026-109618); GHSA-6wmf-4rv5-p3rp (CVE-2026-109619); PHP downloads; PHP supported versions; PHP advance notice; CERT-EU advisory 2026-018; ASD’s ACSC Alert Service notice, 21 October 2026.

Dean Oakley

Written by Dean Oakley

Dean founded Thrive Digital in 2006 and has worked in the design and development space ever since. He received 1st Class Honours in a Bachelor of IT and oversees all technical aspects of our projects.

READY TO START A PROJECT?

Let's do this!
195+ customer reviews