Programming Talk

What Exactly Is The PHP2Shell PHP vulnerability and what you can do?

If your website uses PHP, there is an important security problem you need to know about. It is called PHP2Shell, and unlike many website security problems, it has nothing to do with a bad WordPress plugin or theme.

PHP2Shell is the name given to two serious security flaws inside PHP itself. PHP is the programming language that runs roughly 70% of websites in the world, including WordPress websites. The problem affects PHP versions going all the way back from PHP 5.4 to recent versions.

For someone like me who provides PHP programming and WordPress customization services, this distinction is important. You can have a well-maintained WordPress installation, good plugins and properly written custom code, and still have a problem because the security flaw exists underneath all that, inside PHP itself.

As of October 23, 2026, emergency PHP updates have been released. Attacks trying to use these flaws have also been seen on the Internet. So this is something website owners and server administrators should deal with now rather than leave for a later update.

What exactly is PHP2shell?

PHP2Shell refers to two security flaws identified as CVE-2026-109618 and CVE-2026-109619.

Both flaws can allow hackers to run their own programs on your website’s server without your permission. For example, someone could use this weakness to install a hidden program that steals information from your website, execute PHP scripts that steal user data from your database or use your server to mine cryptocurrency. They may be able to do this without knowing your password, logging into WordPress or getting you to click on anything.

Both flaws have been given a CVSS score of 9.2 out of 10, which puts them in the critical category.

One reason the problem is serious is where the attack happens.

Normally, when someone visits a PHP website, the server receives the request and PHP processes it before your website code does its work. PHP2Shell can attack PHP during this early stage.

This means the problem can occur before your WordPress code, custom security checks or application code even gets a chance to respond.

So installing a WordPress security plugin does not fix PHP2Shell. Neither does updating WordPress itself.

The PHP software running on the server needs to be fixed.

Why WordPress websites can also be affected

WordPress is written mainly in PHP. When someone opens a WordPress page, PHP runs the code needed to produce that page.

But PHP is separate from WordPress.

You could update WordPress to its latest version today. You could update every plugin and theme. You could have carefully written custom code. If the PHP installation underneath the website remains open to PHP2Shell, those WordPress updates do not close this particular security hole.

This is important if you regularly pay for WordPress customization or maintain a business website. The person managing WordPress may not be the person who manages PHP.

On shared hosting, your hosting company normally controls PHP.

On a VPS or your own server, you or your server administrator may need to install the PHP update.

The same applies to websites built through custom PHP programming. The quality of the PHP code inside the application does not protect the server from a flaw that happens before that application code runs.

Which PHP versions have been fixed?

PHP released emergency security updates on October 21, 2026.

The fixed versions are:

  • PHP 8.5.12
  • PHP 8.4.27
  • PHP 8.3.36
  • PHP 8.2.35

The PHP team has asked users to update immediately.

Things become more complicated if your website still uses PHP 8.1 or an older version.

Those older PHP branches no longer receive normal updates directly from PHP. Some Linux distributions and long-term support companies may provide their own fixes, but you need to check what your server provider has done.

This is also a reminder of a problem I often see with older websites.

Sometimes you cannot simply move an old website to the newest PHP version. An old theme, plugin or custom program may stop working. In that situation, you first need to test the website on a staging server, fix the old code and then move to a supported PHP version.

Security updates become much harder when a website has been left on old software for many years.

What should you do if you use shared or managed hosting?

For most small business website owners, this is the section that matters most.

You probably do not need to install the PHP patch yourself. Your hosting company normally handles that part.

But you should confirm that they have done it.

You can take these steps:

  • Ask your hosting company whether your PHP installation has been patched against CVE-2026-109618 and CVE-2026-109619.
  • Ask whether the PHP services were restarted after the update.
  • Check which PHP version your website is using through cPanel, Plesk or your hosting dashboard. You can also check it using a phpinfo.php file containing <?php phpinfo(); ?> on your server. Remove this file immediately after checking because it reveals details about your server.
  • If you are using PHP 8.1 or older, ask your host whether that version has received a security fix.
  • If the host cannot provide a clear answer, consider moving the site to a supported PHP version.

Restarting PHP matters because installing the new files alone may not be enough. The running PHP process needs to load the updated version.

You may also notice some websites going into maintenance mode while hosting companies install the fixes. That does not mean those websites were hacked. In many cases, taking a site offline for a short period is simply a precaution.

Several governments and large organisations temporarily took websites or services offline while dealing with PHP2Shell. Taking a service offline is very different from confirming that it was breached.

What should you do if you manage your own server?

If you run your own VPS, cloud server or dedicated server, you have more work to do.

First, install the security update provided for your PHP version.

Then restart PHP-FPM, Apache or whichever service is running PHP on your server.

You should also check every PHP installation you have. This includes old staging websites, forgotten subdomains, internal dashboards and old projects that are still accessible from the Internet.

Do not assume that running a normal system update automatically means you are safe. Some Linux distributions add security fixes to their own PHP packages without changing the main PHP version number. Check the security notice provided by your Linux distribution or hosting provider.

Government security agencies have also advised organisations to patch PHP systems immediately. Systems that cannot be patched quickly may need to be isolated or temporarily taken offline.

Temporary firewall rules can reduce some attacks, but they should not be treated as a replacement for updating PHP. Cloudflare, for example, introduced WAF protections against PHP2Shell, but the main fix remains updating the affected PHP installation.

Updating PHP is only the first step

There is another problem people sometimes overlook.

Installing the patch closes the security hole, but it does not remove an attacker who may already have entered the server.

According to the research notes, PHP2Shell attack attempts were detected even before the public release of the fixes.

After updating PHP, server administrators should check for signs that something unusual happened.

Look for:

  • PHP files that you do not recognise
  • unexpected administrator accounts
  • strange scheduled tasks or cron jobs
  • unexplained increases in CPU usage
  • unusual PHP errors in server logs
  • changes to files that nobody on your team made

It is also worth checking PHP error logs going back to October 17. One possible sign mentioned by researchers is an unusual number of “Allowed memory size exhausted” errors. Normally these errors are treated as common PHP problems, but during this period they may deserve a closer look.

You may also need to change database passwords, API keys and other private credentials if there is any reason to believe the server was attacked.

This is because PHP2Shell is not limited to running unwanted code. Researchers have also shown that PHP memory may be exposed, potentially revealing passwords, tokens or API keys.

PHP2shell also shows why old websites become a security problem

There is a wider lesson here.

Many businesses continue running websites on old PHP versions because the sites still work. Moving to a newer PHP version may cause an old theme, plugin or custom script to stop working, so the update keeps getting postponed.

Then a security problem like PHP2Shell appears.

Now the PHP update cannot easily be postponed, but updating PHP may break the website.

I see this problem quite often while doing PHP programming and WordPress customization work. Keeping the website reasonably current makes these security updates much easier. Waiting five or six years and then trying to update everything at once can turn a normal maintenance job into a much bigger project.

PHP2Shell is serious because an attacker does not necessarily need your password or a badly written plugin. The weakness sits inside PHP itself.

If your hosting company manages PHP, ask them whether they have patched it. If you manage your own server, install the appropriate update and check the server for signs of earlier attacks.

And if your website is stuck on an old PHP version because the site breaks whenever you try to update it, that is another problem worth fixing.