How to Fix PHP2Shell Vulnerability in WordPress Websites (Easy Guide)
If you run a WordPress website, you have probably seen the name “PHP2Shell” in the news this week. It is one of the most serious website security problems in years, and it cannot be fixed by updating WordPress or installing a security plugin. This guide explains what happened in plain language, how to check if your site is exposed, and exactly what to do about it, step by step.
The Short Answer
- PHP2Shell is the nickname for two critical security flaws in PHP, the programming language WordPress runs on.
- The fix is a PHP update on your server, not a WordPress update.
- The safe PHP versions are 8.5.12, 8.4.27, 8.3.36 and 8.2.35 (or newer), or an older version that your host has specifically patched.
- If you use shared hosting, your host installs the fix. Your job is to ask them, confirm the answer, and then check your site for signs of a break-in.
What Is PHP2Shell?
PHP2Shell is the nickname for two vulnerabilities in the core of PHP, tracked as CVE-2026-109618 and CVE-2026-109619. PHP’s own security team rated both 9.2 out of 10 on the CVSS v4.0 severity scale, which is “critical.”
In simple terms, an attacker can send a specially crafted request to a website and make the server run the attacker’s own commands, without needing a username or password. The word “shell” in the name refers to that: a hacker getting a command line on your server.
The researchers who found the flaws, including teams from Wiz, Calif and OpenAI, showed the attack working against a normal WordPress install. They also found that it can leak pieces of the server’s memory, which may contain things like passwords and access keys.
The PHP team released the fixes on October 21, 2026. Technical details leaked online a day earlier, on October 20, and security companies reported attack attempts starting before the fix was even available. Amazon’s security team reported seeing one attempt as early as October 17. These are reports of attempts, not proof that every attempt succeeded, but they show how quickly attackers moved.
Why Is Everyone Calling It “Black October”?
“Black October” is not an official name. It is a nickname that spread on social media after PHP2Shell landed in the same days as several other unrelated security incidents, including a critical flaw in GitLab, a poisoned release of an AI software library, and breaches at some hosting platforms.
One thing worth knowing: security analysts point out that these incidents are not one single coordinated attack. PHP2Shell is the one that matters most to website owners, because PHP powers a huge share of the web (estimates say nearly 70 percent of websites).
Why WordPress Sites Are Affected
Every time someone visits a WordPress site, PHP runs first, and only then does it load WordPress and your plugins. PHP2Shell sits in that first layer. This has two important consequences:
- Updating WordPress, your theme or your plugins does not fix it. WordPress has said no update on its side is needed, because the problem is not in WordPress.
- Security and firewall plugins cannot block it, because the attack happens before those plugins even start working.
Only a PHP update on the server fixes the root problem.
Is Your Site Affected? Check Your PHP Version
You can see your PHP version from inside WordPress:
- Log in to your WordPress dashboard.
- Go to Tools, then Site Health.
- Open the Info tab and click the Server section.
- Look for the line called PHP version.
Then compare it with this table:
| Your PHP branch | Safe from version |
|---|---|
| 8.5 | 8.5.12 |
| 8.4 | 8.4.27 |
| 8.3 | 8.3.36 |
| 8.2 | 8.2.35 |
| 8.1 and older | No official fix from PHP. Only safe if your host or server vendor added the fix. You should upgrade anyway. |
A warning before you panic: a lower-looking number does not always mean you are unprotected. Some hosts and Linux systems add the security fix without changing the version number. For example, Hostinger said its servers were fixed even though sites may still show an older-looking number like 8.5.11, and Ubuntu’s fixed package for version 24.04 still reports 8.3.6. This is why you must ask your host directly rather than trusting the number alone.
Step-by-Step: How to Fix It
Step 1: Make a Backup
Before changing anything, take a full backup of your files and your database, and store a copy somewhere outside your server (your computer or cloud storage). If something breaks later, you can restore it.
Step 2: Ask Your Hosting Company
On shared hosting and managed WordPress hosting, the host controls PHP at the server level, so they have to install the fix. Send them a short message like this:
“Hi, my site runs PHP [your version]. Has the fix for PHP2Shell (CVE-2026-109618 and CVE-2026-109619) been installed on my server? If not, when will it be? Thank you!”
Keep asking until you get a clear answer. A reply like “we added firewall protection” is good, but it is not the same as “PHP has been updated.” You want the second one.
Several big hosts announced that they had already patched their platforms by October 22 to 24, including Cloudways, DreamHost, Flywheel, Hostinger, Kinsta, Namecheap, OVHcloud, WP Engine and others. SiteGround said it applied server-level protection and turned off the affected PHP features. If you cannot find your host’s announcement, contact their support.
Step 3: Switch to a Supported PHP Version in cPanel
If you are on cPanel hosting, you can usually choose your PHP version yourself:
- Log in to cPanel.
- Find and open MultiPHP Manager.
- Tick the box next to your domain name.
- Pick a current PHP version from the dropdown. PHP 8.3 or 8.4 is a safe choice for most WordPress sites.
- Click Apply.
- Open your website and click through the important pages (home page, contact form, checkout if you have a shop) to make sure everything still works.
Important detail many guides skip: the cPanel version menu only switches between versions that are already installed on the server. It does not download the security fix by itself. Switching to a newer branch is still the right move, especially if you are on PHP 8.1 or older, but you must still confirm with your host that their installed build contains the PHP2Shell fix.
If your site breaks after the switch, the cause is almost always an old plugin or theme that does not support the newer PHP version. Update or replace that plugin, or switch back temporarily and ask your host for a patched build of your old version while you fix the plugin.
Want the full walkthrough for cPanel, Hostinger, Bluehost and DreamHost? Read our guide on how to update PHP in WordPress without breaking your site.
Step 4: If You Manage Your Own Server (VPS, Dedicated or Docker)
If you rent a virtual or dedicated server, the update is your responsibility:
- Install the fixed PHP packages from your Linux distribution’s security updates. Ubuntu, Debian and Red Hat-family systems all released fixes.
- Restart PHP-FPM or Apache afterward. This step is easy to forget, and until you restart, the old vulnerable code is still running in memory.
- With Docker, pulling a new image is not enough. Rebuild and recreate your containers using a fixed PHP image.
- Trust your distribution’s security notice rather than the version number alone, for the reason explained above.
GoDaddy, Namecheap and others have noted that customers with their own VPS or dedicated server need to apply the update themselves.
Step 5: Confirm the Fix
After your host says it is done, recheck Tools, Site Health, Info, Server in WordPress and write down the PHP version. If you are still unsure, ask your host to confirm in writing that your account runs a patched build.
What If You Cannot Update PHP Today?
Sometimes your host is slow or your old plugins block an upgrade. These options buy you time, but none of them replaces the real fix:
- Put Cloudflare in front of your site. Cloudflare turned on protection for PHP2Shell for all plans that have its firewall enabled, including the free plan. It only helps if your visitors actually go through Cloudflare, and Cloudflare itself describes such rules as a stopgap.
- Ask your host to apply temporary PHP settings. PHP’s advisories and security vendors mention measures such as turning off the session upload-progress feature. Only the person running the server can do this, and the protection is partial.
- Do not rely on a maintenance mode plugin. The attack can happen before WordPress even loads, so a plugin cannot stop it.
- If you run your own server and cannot patch or protect it at all, taking the site offline for a day is a reasonable choice. US agency CISA and others advised that servers that cannot be updated, or that run PHP 8.1 or older with no fix, should be taken offline until they can be.
If your host will not give you a date for the fix, it may be a good time to consider moving to a better host.
How to Check If Your Site Was Already Hacked
Updating PHP closes the door, but it does not remove someone who already got in. Because attempts started days before the fix, it is smart to look at activity from around mid-October onward. Most hacks are quiet, so do a five-minute check:
- Users: in your WordPress dashboard, go to Users and filter by Administrator. Do you see anyone you do not recognize?
- Plugins: is there any plugin installed that you did not install?
- Google: search for site:yourdomain.com and look for pages you never wrote, such as casino, pharmacy or foreign-language spam pages.
- Google Search Console: open it and check the Security issues report.
- Uploads folder: the wp-content/uploads folder should contain images and documents. Any file ending in .php inside it is a red flag. You can look at it through your host’s File Manager.
- Messages from your host: warning emails about malware, spam or unusual resource use.
What to Do If You Find Something Suspicious
- Do not panic, and do not try to clean everything by yourself if you are not sure what you are looking at.
- Contact your host and ask them to scan the server and restore a backup from before the problem appeared.
- Change all your passwords: WordPress admin, hosting account, FTP, and database.
- Delete unknown admin users and unknown plugins.
- Because PHP2Shell can expose server memory, security experts also recommend rotating any API keys, payment gateway keys and email (SMTP) passwords your site uses, and regenerating the security keys (salts) in your wp-config.php file.
- If you run a shop or collect customer data, consider getting professional help, because you may have legal duties to report a data exposure.
Frequently Asked Questions
Is PHP2Shell a WordPress bug?
No. It is a flaw in PHP itself. WordPress is affected only because it runs on PHP. The same flaws also affect other PHP-based systems such as Drupal, Joomla and Magento.
Will a WordPress update fix it?
No. There is no WordPress update for this. The fix has to be installed on the server by whoever runs it, usually your hosting company.
Will my security plugin protect me?
No. The attack happens before WordPress and its plugins load, so security plugins never see it. A firewall in front of your server, such as Cloudflare, can help, but a plugin cannot.
Do I need to take my website offline?
Usually not. If your host confirms the fix or temporary protection is in place, you can keep your site running and monitor it. Taking a site offline makes sense mainly if you run your own server and cannot patch it at all.
I am on WordPress.com or another fully managed service. Do I need to do anything?
The company that runs the platform updates PHP for you. You can still do the five-minute check above for signs of a hack.
My site is on PHP 7.4 or 8.1. What now?
Ask your host first. Some hosts and control panels, including cPanel, released patched builds for older versions. That only buys you time. Plan an upgrade to PHP 8.3 or 8.4, starting with updating or replacing any plugins that hold you back.
Why was it so urgent?
Because details leaked before the fix was ready and attackers began trying the exploit right away. Many governments and companies even took websites offline temporarily while they installed the patch. The time between a bug being made public and being attacked is now measured in hours, so quick action matters.
Quick Checklist
- Back up your site (files and database).
- Check your PHP version in Tools, Site Health, Info, Server.
- Ask your host to confirm the PHP2Shell fix is installed.
- Switch to PHP 8.3 or 8.4 in cPanel’s MultiPHP Manager if you are on an older version.
- If you cannot update today, use Cloudflare and ask your host for temporary protection.
- Check Users, Plugins, the uploads folder and Google for signs of a hack.
- If anything looks wrong, restore a clean backup and change all passwords.
Final Thoughts
PHP2Shell is a good reminder that website security does not stop at WordPress. This time the weak point was the layer underneath it, and the solution came from the server, not from a plugin. The good news is that fixes are already available, and most big hosts have rolled them out. Take ten minutes today to confirm yours has.
This guide is general information, not professional security advice. Hosting setups differ, so follow your host’s instructions where they differ from the steps above. Hosting status and official guidance change quickly, so check your host’s status page for the latest.
Sources
- PHP official security release announcement: https://www.php.net/archive/2026.php
- PHP advisory for CVE-2026-109618: https://github.com/php/php-src/security/advisories/GHSA-w8hw-w9fx-j79w
- PHP advisory for CVE-2026-109619: https://github.com/php/php-src/security/advisories/GHSA-6wmf-4rv5-p3rp
- CISA alert, Critical Vulnerabilities in PHP Require Immediate Patching: https://www.cisa.gov/news-events/alerts/2026/10/21/critical-vulnerabilities-php-require-immediate-patching
- Wiz Research, PHP2Shell technical write-up: https://www.wiz.io/blog/php2shell-php-rce
- Cloudflare, PHP vulnerabilities and WAF protection: https://blog.cloudflare.com/php-vulnerabilities-waf-protection/
- PHP Foundation security release post: https://thephp.foundation/blog/2026/10/21/todays-php-security-release-and-how-were-strengthening-php-security/
- Meow Apps, PHP2Shell guide for WordPress (host status list): https://meowapps.com/php2shell-wordpress/
- WP Umbrella, PHP2Shell and WordPress: https://wp-umbrella.com/blog/php2shell-what-the-critical-php-vulnerabilities-mean-for-wordpress-sites/
- Black October overview (Wikipedia): https://en.wikipedia.org/wiki/Black_October_(information_security)