PHP2Shell Vulnerability: What WordPress Site Owners Must Do

17 min read

PHP2Shell is the name given to 2 critical vulnerabilities in PHP, rated CVSS v4.0 9.2, that can allow an unauthenticated attacker to run code on an affected server. PHP released fixed versions on 21 October 2026, and website owners should update the PHP runtime serving their site as soon as possible. This guide explains who may be affected, how to check the live PHP version, how to patch it, what temporary mitigations can and cannot do, and what to inspect if compromise is suspected.

Table of Contents

Quick Summary

ItemWhat website owners need to know
What is PHP2Shell?2 critical vulnerabilities in the PHP runtime that may allow remote code execution without a login.
SeverityBoth vulnerabilities have a CVSS v4.0 score of 9.2.
Who may be affected?Websites and applications using vulnerable PHP, including WordPress, Drupal and Joomla sites.
First fixed releasesPHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35.
Best next stepUpdate the PHP runtime or verify that your hosting vendor installed a complete backported fix. Restart the relevant workers and verify the live runtime.
If you cannot patchApply the PHP team’s temporary measures with administrator support, limit exposure, and treat the system as vulnerable until it is patched.

A WordPress update alone does not fix PHP2Shell. The flaw sits in PHP itself, so checking plugins and themes is useful but does not replace patching the PHP runtime.

What Is the PHP2Shell Vulnerability?

PHP is the programming language many websites use to build pages, process forms, accept uploads and communicate with databases. WordPress, Drupal and Joomla all rely on PHP, which runs inside the hosting environment.

PHP2Shell refers to 2 critical flaws in PHP’s core runtime. The PHP team released emergency security updates on 21 October 2026. Exploitation may allow an unauthenticated attacker to run code on an affected server without signing in first.

Think of PHP as the engine inside a website. WordPress is an application that uses that engine. If the engine has a flaw, updating WordPress, a plugin or a theme does not repair the vulnerable PHP code.

The risk applies to different PHP setups, including PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed. A site may need a server or hosting package update even when its application is up to date.

A vulnerable version does not prove that an attacker has compromised your site. It means the site may be exposed, so treat a public server as urgent until its runtime and package status are verified.

Get Help Planning Your PHP Security Review

Share the PHP version and hosting setup with Qrolic to discuss practical next steps for your website.

CTA Wave
CTA Triangle BG

What Do CVE-2026-109618 and CVE-2026-109619 Do?

The flaws have different technical causes. You do not need to understand PHP’s memory management to respond, but the basic explanation helps show why upgrading matters.

CVE-2026-109618: Out-of-Memory Handling

This flaw affects how PHP handles a request when it runs out of memory. Some internal request data may not be fully initialized, but cleanup code can treat it as valid. Under the right conditions, this memory corruption can lead to remote code execution.

A specially crafted multipart form request can trigger the vulnerable error path. Since the problem sits inside PHP’s request processing, application checks may never get a chance to stop it.

CVE-2026-109619: Stale Request Data

This flaw involves internal request data that should no longer be used after PHP frees its memory. A later request handled by the same worker may use that stale reference before normal setup resets the state.

In simple terms, PHP can retain a pointer to memory that is no longer valid. Researchers demonstrated remote code execution against test deployments of WordPress, Drupal and Joomla. This does not mean every website has been compromised, but it shows common content management systems can be affected when their PHP runtime is vulnerable.


Both vulnerabilities have a CVSS v4.0 score of 9.2, which is classified as critical. The official CVSS metrics also list high attack complexity and present attack requirements, so successful exploitation depends on specific technical conditions. This does not reduce the urgency: administrators should install a fixed PHP release or verify that their hosting provider has applied a complete security backport.

How PHP2Shell Was Discovered and Why It Matters Now

Wiz Research reports that it discovered the first PHP vulnerability on August 19, 2026. Researchers confirmed unauthenticated remote code execution against Drupal on August 20 and WordPress on August 21, then reported the vulnerabilities to the PHP security team on August 24.

PHP acknowledged the reports on September 21, 2026. Fixed PHP releases and public disclosure followed on October 21, 2026.

Researchers demonstrated remote code execution against test deployments of WordPress, Drupal, and Joomla. These demonstrations show the potential impact, but they do not prove that every vulnerable website has been compromised.

Which PHP Versions Are Affected?

The first fixed releases for supported PHP branches are below. If your website uses an earlier version, treat it as affected unless your hosting provider confirms a complete security backport.

PHP branchFirst fixed releaseWhat to do
PHP 8.58.5.12Update to 8.5.12 or a later fixed release.
PHP 8.48.4.27Update to 8.4.27 or a later fixed release.
PHP 8.38.3.36Update to 8.3.36 or a later fixed release.
PHP 8.28.2.35Update now and plan migration to a newer supported branch.
PHP 8.1 and olderNo current upstream support branchVerify a vendor backport or migrate to a supported branch.

Security research identified affected PHP versions going back to PHP 5.4. PHP 8.1 and older no longer receive normal security updates from the upstream project, although some distributions and long term support vendors provide backported fixes.

Ask your vendor to confirm that both CVE-2026-109618 and CVE-2026-109619 are fixed in the exact package and build serving your site. A vendor may backport a patch without changing the visible PHP version number, so the version displayed by a control panel may not tell the whole story.

PHP 8.2 reaches end of life on 31 December 2026. PHP 8.2.35 fixes these vulnerabilities, but administrators should plan to move to a supported branch before security updates stop.

How to Identify Whether Your Website Is Vulnerable

Check the PHP version assigned to your website, not just the version installed on the server. One server can run different PHP versions for different domains, and the command line version may differ from the web runtime.

Check WordPress Site Health

In WordPress, open Tools, then Site Health, then Info, then Server. Find the PHP version reported for the site and compare it with the fixed versions above. If it is older or the result is unclear, ask your host to verify the active handler and package build.

Check Your Hosting Panel

Review the PHP version selected for each domain in your hosting panel. In cPanel, check the domain’s PHP version settings and package updates. In Plesk, review the PHP handler assigned to each domain and apply the relevant vendor update.

For shared or managed hosting, send the provider both CVE identifiers. Ask which handler serves your domain, whether a fixed package or backport is active, and whether the relevant worker processes were restarted.

Check a Linux Server

These read only commands can help on Debian or Ubuntu:

# Checks the command-line PHP version only
php -v

# Lists installed PHP and Apache PHP packages
dpkg -l | grep -E '^ii\s+(php|libapache2-mod-php)'

# Shows relevant server and PHP-FPM services
systemctl list-units --type=service --all | \
  grep -E 'php.*fpm|apache2|nginx|lsws|litespeed'

# Shows running PHP-FPM processes
ps -eo pid,user,args | grep '[p]hp-fpm'

These commands are a starting point, not proof that every web request uses a patched runtime. php -v checks the command line binary only. For Docker, check the PHP version inside the deployed container and redeploy a patched image. For hosting panels, check each domain separately.

How to Fix PHP2Shell Permanently

The complete fix is to install a patched PHP runtime or a vendor package with a verified fix for both vulnerabilities. A WAF, security plugin or temporary configuration change cannot replace the corrected PHP code.

Step 1: Back Up and Plan the Update

Confirm that a recent backup exists and that you know how to restore it. For a business critical site, follow the host’s update process and test compatibility on staging when practical. Do not let routine scheduling delay an urgent update on an exposed server.

Step 2: Install the Correct Fixed Release

Update to the fixed release for your branch: PHP 8.5.12, 8.4.27, 8.3.36 or 8.2.35. Obtain packages from your operating system repository, hosting vendor or official PHP distribution, as appropriate for your setup.

Read the official PHP security advisory before changing production settings. Linux distributions and long term support vendors may provide their own packages, so confirm the exact package revision has been deployed.

If you use PHP 8.1 or older, ask your vendor whether a fixed backport exists for your exact package. If not, plan a move to a supported PHP branch as soon as application compatibility allows.

Step 3: Restart the Correct PHP Workers

Old PHP worker processes may continue running after package installation. Restart the service or application pool that actually serves the website, following the hosting provider’s procedure. Depending on the setup, this may mean restarting PHP-FPM, Apache, or the deployed container.

For example, a PHP 8.3 FPM server might use sudo systemctl restart php8.3-fpm. Do not copy that service name without checking your installed version. Restarting the wrong service can leave the vulnerable runtime active.

Step 4: Verify the Active Version

After restarting, check the web runtime through WordPress Site Health or the hosting panel. Confirm that the reported version or vendor package build is fixed, and test key site functions such as login, forms, uploads and checkout.

Review PHP and web server logs for errors after deployment. Verification should show that the patched runtime is serving requests, not merely that an update command completed successfully.

Temporary Mitigations If You Cannot Upgrade Immediately

PHP’s official guidance says the following measures reduce exposure to specific attack paths but do not make a vulnerable installation safe. Apply them only while arranging the full update. If you do not manage server configuration, ask your hosting provider to apply and verify them.

Reduce the Out-of-Memory Attack Path

The PHP advisory includes memory_limit = -1 as a temporary measure for CVE-2026-109618. It removes the configured PHP memory ceiling, but an underlying allocation failure can still reach vulnerable code. Uncontrolled memory use can also affect service availability, so apply it only after administrator review and with suitable host, container or cgroup limits.

The advisory also recommends a low post_max_size. For sites that do not need uploads, it gives 8M as an example. If uploads are necessary, it gives 32M as an example and says upload_max_filesize must remain below post_max_size.

Example for an application that does not need file uploads:

; Temporary mitigation only, not a PHP2Shell fix
memory_limit = -1
post_max_size = 8M

Do not copy the 8M limit if it breaks required uploads. Ask an administrator to enforce request size, multipart part counts, input field counts, header counts and nesting depth at the web server or proxy layer where possible.

Disable Session Upload Progress

To block confirmed paths associated with CVE-2026-109619, PHP recommends disabling session upload progress in server level configuration that applies before request parsing, such as php.ini, an FPM pool or server configuration:

session.upload_progress.enabled = 0

Do not rely on ini_set() or a per directory .user.ini file for this measure. Restart every relevant PHP worker after applying it. This setting blocks specific paths, not every variant.

Additional PHP 8.5 Mitigation

For PHP 8.5, the advisory also recommends disabling fatal error backtraces for a confirmed path:

fatal_error_backtraces = 0

Apply the setting at the correct server configuration layer and restart affected workers. It is specific to PHP 8.5 and is not a full fix.

Add a Web Application Firewall Layer

A web application firewall or reverse proxy may filter suspicious multipart requests and enforce limits before traffic reaches PHP. Use incident specific rules from a trusted provider and check that attackers cannot bypass them by reaching the origin server directly.

A WAF is an extra layer, not a replacement for updating PHP. Inspection limits, parser differences and other attack paths can leave a vulnerable runtime exposed.

How to Verify the Patch

Use this checklist after the update or vendor mitigation:

  • Confirm the PHP version or vendor package build assigned to every public domain.
  • Confirm the package addresses CVE-2026-109618 and CVE-2026-109619.
  • Restart the PHP-FPM pool, Apache handler, application service or container that serves the site.
  • Recheck the runtime through WordPress Site Health or the hosting panel.
  • Test login, forms, uploads, checkout and scheduled tasks.
  • Review PHP and web server logs for fatal errors or unusual worker restarts.
  • Record the package, deployment time, restart and verification result.

Complete these checks for every site, subdomain and production environment. A staging site may be patched while the public site still uses the older runtime.

Signs That a Website May Have Been Compromised

A vulnerable version does not prove a successful attack, and one unusual log entry is not proof of PHP2Shell exploitation. Investigate further if several suspicious signs appear around the period before patching.

Look for unexpected PHP files in upload directories, unfamiliar administrator accounts, changed configuration files, unusual cron entries, unexpected child processes, unexplained outbound connections, repeated PHP-FPM crashes or sudden increases in HTTP 500 responses.

Review web server, PHP, operating system and firewall logs. Malicious requests may use multipart form data, but request patterns alone do not prove a successful exploit. Application logs may contain little detail because a runtime flaw can occur before WordPress code executes.

If compromise is plausible, preserve logs and a snapshot where practical. Isolate the system if you can do so safely, then patch or rebuild from trusted sources. Rotate exposed passwords, API keys and database credentials from a clean environment, and verify the server before returning it to service.

See Qrolic’s website hacked recovery guide for additional recovery considerations. Patching closes the known vulnerable path but does not remove an existing backdoor.

What to Do If You Cannot Patch Today

Treat the public website as vulnerable until a fixed package is active. Contact your host or administrator urgently and ask them to install a supported package or apply the official temporary measures. If the system cannot be patched or adequately protected, consider restricting public access until remediation is possible.

Do not rely on changing a WordPress password, updating plugins, hiding the PHP version, installing a security plugin or enabling a WAF as the only response. Those actions do not repair the vulnerable PHP code.

If your vendor uses backported packages, ask for confirmation against both CVE identifiers.

WordPress Security Checklist After Patching

Patch PHP first, then review the website and hosting setup. These actions reduce other risks but do not substitute for the runtime update.

  • Check every WordPress site, subdomain, staging site and PHP pool.
  • Update WordPress core, plugins and themes from trusted sources.
  • Remove unused or abandoned extensions and themes.
  • Review administrator accounts and enable multifactor authentication where available.
  • Protect wp-config.php, hosting access, database credentials and API keys.
  • Prevent PHP execution from upload directories unless a reviewed requirement needs it.
  • Use appropriate file permissions and isolate unrelated sites where practical.
  • Store backups outside the public web root or off site, and test restoration.
  • Monitor file changes, cron tasks, PHP processes and outbound connections.

If WP-CLI is available, these commands check core and plugin file integrity:

 wp core verify-checksums
 wp plugin verify-checksums --all

They can identify some unexpected changes, but do not detect every backdoor. Compare custom code and premium plugins with known good vendor copies when needed. A successful checksum result does not prove the whole server is clean.

How to Reduce the Risk of the Next Incident

Maintain an inventory of websites, domains, PHP handlers, containers and hosting vendors. Without it, one site may be patched while another public endpoint continues using a vulnerable package. Include staging systems and products that bundle their own PHP runtime.

Set a process for emergency updates. Identify who checks advisories, who applies changes, and who verifies the live runtime. Keep tested backups, but do not let routine release scheduling delay an urgent fix on an exposed server.

Monitor notices from PHP, your operating system vendor and hosting provider. Test major PHP upgrades for compatibility, and plan migrations before a branch reaches end of life. Centralise logs and alert on unexpected file changes, worker crashes or suspicious processes.

For broader prevention measures, read Qrolic’s WordPress and website security guide. Use a wider security review to check maintenance, backups, monitoring and recovery after the emergency PHP fix is complete.

Why Choose Qrolic

PHP2Shell is a server level issue, so resolving it starts with verifying the PHP runtime and hosting configuration rather than updating WordPress alone. Qrolic Technologies provides website resources for owners reviewing security and maintenance, and you can Contact Qrolic to discuss your website requirements and the scope of a broader review.

Our Web Services for WordPress Businesses

  • WordPress Performance & Security Audit: Qrolic’s WordPress performance and security audit is a starting point for reviewing broader website performance and security after PHP remediation. It complements emergency runtime patching but does not replace upgrading PHP or investigating a suspected compromise.

Conclusion

The PHP2Shell vulnerability affects PHP itself and may allow unauthenticated remote code execution on vulnerable servers. Check the runtime serving your website, install a fixed release or verify a complete vendor backport, restart the relevant workers, and confirm the live version. Temporary settings can reduce specific risks, but only the correct PHP update provides a complete remediation; investigate suspicious activity because patching does not rule out an earlier compromise.

FAQs

Is PHP2Shell a WordPress vulnerability?

No. PHP2Shell affects PHP’s core runtime, which WordPress uses to process requests. Updating WordPress core, a theme or a plugin does not fix an unpatched PHP runtime.

Which PHP versions are affected by PHP2Shell?

Security research identified affected versions going back to PHP 5.4. The first fixed releases for supported branches are PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35. For older branches, confirm the vendor’s exact backport status.

How do I know whether my WordPress site is vulnerable?

Open Tools, then Site Health, then Info, then Server to see the PHP version reported by WordPress. Compare it with the fixed release for that branch, then ask your host to verify the handler and package if needed.

Does updating PHP prove that my website was not hacked?

No. The update fixes the known vulnerability in the patched runtime, but does not show whether someone exploited an earlier version. Review logs, files, processes, administrator accounts and credentials if you suspect suspicious activity.

Can a WordPress security plugin stop PHP2Shell?

A security plugin may provide useful application level checks, but it cannot replace a PHP runtime update. The flaw can be triggered before normal WordPress code runs, depending on the server and attack path.

Are PHP-FPM and Apache mod_php affected?

Yes. The PHP advisory identifies PHP installations serving web requests, including PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed. Check each active handler rather than assuming only one setup is at risk.

What if my host shows the same PHP version number after updating?

Some vendors provide a backport without changing the visible upstream version. Ask whether the exact package includes fixes for both CVEs, and confirm that the active workers were restarted.

Is session.upload_progress.enabled = 0 enough?

No. It reduces exposure to confirmed paths associated with CVE-2026-109619, but does not repair PHP or block every variant. Use it only as a temporary measure while arranging a complete patch.

Should I set memory_limit = -1 to fix PHP2Shell?

It is a temporary measure listed in the PHP advisory for a specific attack path, not a permanent fix. It removes the configured PHP memory ceiling and can affect availability if memory is not controlled elsewhere, so get administrator review first.

What should I do if I cannot update PHP immediately?

Contact your host, apply official temporary measures with administrator support, and restrict public access if the system cannot be adequately protected. Keep working toward the fixed release and verify the live runtime after the update.

Enjoying our content?

Like what you see? Share with a friend.

Have WordPress project in mind?

Explore our work and and get in touch to make it happen!