Accepting projects ·CZ Get in touch →

Critical PHP vulnerability: what a website administrator must do within 24 hours

With a critical PHP vulnerability, the first day decides. What to update right away and what to check after the fix, shown on how we handled PHP2Shell.

A critical vulnerability in PHP itself affects every website that runs on PHP, including WordPress and PrestaShop. There is rarely a week to fix it. We wrote down what a website administrator should get done on the first day, based on how we handled PHP2Shell.

What happened

On 21 October 2026 the PHP developers released fixed versions 8.5.12, 8.4.27, 8.3.36 and 8.2.35. They fix two vulnerabilities, together called PHP2Shell (CVE-2026-109618 and CVE-2026-109619), which let an attacker run their own code on the server without logging in.

Servers where PHP runs as an Apache module (mod_php) are most at risk. There the attack happens even before the website's code starts, so even a well-secured application doesn't help. With PHP-FPM the risk is lower, but it needs updating as well.

The first few hours: where you have PHP

Before you start updating, you need a list. For each website, find out:

  • where it runs: your own server or VPS, where you update, or shared hosting, where the provider does it
  • which PHP version actually serves the website, not which one the command line reports
  • how PHP is connected: mod_php or PHP-FPM

Watch out for the version. The php -v command on the server may report a different installation than the one the website uses. A small script with phpversion() is more reliable, or the X-Powered-By header if the server sends it. Some Linux distributions also ship the fix under the old version number, and there the package number is what counts.

By the end of the day: update, or at least mitigate

  1. Update your own servers right away, as soon as the packages are available. Back up the database before the update, restart PHP-FPM or Apache after it.
  2. Where the update isn't available yet, turn off session.upload_progress.enabled in the server configuration. It's the recommended temporary mitigation, not a fix. It's set in php.ini or in the FPM pool configuration, not in the website's code.
  3. Check shared hosting yourself, don't wait for an email from the provider. Upload a check script, find out the version and delete the script again.
  4. After the update, test that the website works, especially forms and the shopping cart.

The fixed PHP versions came out on 21 October. By the next day we had updated the servers we manage, and on shared hosting we checked the version directly on the website. For one website on PHP 5.6, for which no fix will come out, we warned the owner in writing on 22 October.

Lukáš Hrubý Managing director, HRUBY Software

When old PHP is running

Fixed versions came out only for the supported branches 8.2 to 8.5. A website on PHP 7.4 or 5.6 will stay vulnerable until it is switched to a newer PHP. With an old WordPress this often means updating the core, the theme and the plugins first. That isn't a job for a few hours, but you can start right away.

If the website can't be switched, consider taking it offline for a while or putting it behind a login. Leaving it running on the open internet without the fix is a gamble.

After the update: was the website already hacked?

The update closes the hole, but it doesn't tell you whether someone got through it earlier. So check:

  • error logs, especially repeated 500 errors and out-of-memory messages
  • new PHP files in the website's folders
  • processes started by PHP that have no business being there, such as sh, curl or wget
  • new accounts in the admin and new scheduled tasks

On two public servers we went through after the update, there were no 500 errors, foreign processes or new files. The log of one of them held only attempts at xmlrpc.php, the usual WordPress scanning we wrote about in the article on the forgotten doors of WordPress. If you find something suspicious, proceed as with a hidden hack: first a copy, then a restore from clean sources and a change of all passwords.

When to call in an expert

When you don't know everywhere PHP runs, you don't have access to the server, or the website runs on a version for which no fix came out. As part of website management, we watch security advisories and do PHP updates ourselves.

Written by Ing. Lukáš Hrubý, HRUBY Software · ← All articles

Dealing with the same thing?

We'll look at it with you. The first consultation is free. More about the service: Website Management.

Book a consultation →
// Contact

Get in touch.

Tell us what you need, or just call. We reply within one business day.

// Encrypted in transit · privacy policy