PHP2Shell: what it means for your website

PHP2Shell website security: a website and server protected by a shield and padlock

If your website runs on WordPress, or almost any other common website software, this week’s PHP2Shell security alert affects you. You do not need to be technical to deal with it. You just need to ask your hosting provider one clear question.

On Wednesday 21 October, the team behind PHP announced two serious security flaws, now known as PHP2Shell. They released fixes the same afternoon, and the UK’s National Cyber Security Centre (NCSC) urged organisations to update straight away. Some well known sites, including the Metropolitan Police and several council websites, were taken offline for a while as a precaution.

What is PHP?

PHP is the software that runs on the web server behind your website. It builds each page when someone visits, handles contact forms and runs the admin area you log in to.

You will rarely see it, but it is everywhere. PHP powers around 70% of websites where the technology can be identified, including every WordPress site, and platforms such as Drupal, Joomla and Magento.

PHP is not something you install on your own computer or phone. It lives on the server, which is looked after by your hosting provider.

Why PHP2Shell is serious

The flaws could let an attacker run their own code on a web server without needing a username or password. In the worst case, that means taking control of the website, adding harmful content or reaching data stored on the server.

Both flaws are rated 9.2 out of 10 for severity. Security researchers had seen attempts to use them before they were made public, and attacks have been reported since.

If you noticed a site go offline this week, that does not mean it was hacked. In most cases its owners took it down for a short time to apply the fix safely.

Is my website affected by PHP2Shell?

If your website uses PHP, it was affected until the fix was applied on your server. Whether it is still at risk depends on your hosting provider, and on the version of PHP your site runs.

  • Supported versions (PHP 8.2 to 8.5): official fixes are available. Your host needs to install them.
  • Older versions (PHP 7.4, 8.0 and 8.1): there is no standard update, but hosts can apply special patches. Ask whether yours has.
  • Very old versions (PHP 7.3 and earlier): there is no fix. The only safe route is to upgrade, which may mean updating the website itself.

If you do not know which version your site uses, that is fine. Your hosting provider or web developer can tell you in a minute.

What to do about PHP2Shell

Contact your hosting provider, or whoever looks after your website, and ask them to confirm the PHP2Shell fix is in place. Ask for a confirmation that it has been installed, not just that it is planned.

These are the questions worth asking:

  1. Has the PHP2Shell fix been applied to the server my website runs on?
  2. Which version of PHP is my website using, and is it still supported?
  3. If my site is on an older version, has it been patched, and when can we upgrade?
  4. Have you added any extra protection, such as firewall rules, while this is going on?
  5. Is there any sign that my site has been targeted?

If you have more than one website, or an old site nobody uses any more, check those too. Forgotten sites are often the easiest way in.

While you are at it, it is a good moment to change the password you use to log in to your website. Use a strong one you do not use anywhere else, and turn on two-factor login if it is offered.

A few common mix ups

  • “I updated WordPress, so I’m fine.” Not on its own. Updating WordPress and its plugins is good practice, but it does not update PHP. That happens on the server.
  • “I need to update something on my laptop.” No. This is a server issue, so there is nothing to install on your own devices.
  • “A site was offline, so it must have been hacked.” Usually not. Taking a site down briefly to apply a fix is a sensible precaution.

If you visit a website that suddenly shows strange content, unexpected downloads or repeated login prompts, leave the page and do not enter your details.

What we saw this week

This is not just a theoretical risk. One of the client websites we look after was hacked this week. We rolled it back and made it secure within the hour, and we then made sure every other website we look after was secure too.

Acting quickly made all the difference, which is why we would encourage you to speak to your provider today rather than waiting.

Need a hand?

Your hosting provider is the right first call. If you are unsure who that is, or you would like someone to check things for you, get in touch and we will happily point you in the right direction.

Sources