Skip to content
Making Digital Bharat Surakshit: free VAPT reports for eligible organisations.

PHP2Shell Vulnerability (October 2026 Critical Alert): What It Is and How to Protect Your Website

PHP2Shell is a pair of critical flaws in PHP that can let an attacker run their own code on an unpatched web server without logging in. Here is what it means in simple words, and how to check and update your PHP version.

Vicky Choudhary

· 14 min read

https://trojanbyte.com/blog/php2shell-vulnerability-october-2026-critical-alert-what-it-is-and-how-to-protect-your-website

PHP2Shell is the name given to two critical security flaws in PHP, tracked as CVE-2026-109618 and CVE-2026-109619. In October 2026, the PHP team released an emergency security update to fix them.

If your website runs on a PHP version that does not have this fix, an attacker may be able to run their own code on your server without any username or password. This is called remote code execution (RCE), one of the most serious kinds of security problems. That is why PHP2Shell is being described as a critical PHP RCE vulnerability.

In this guide, we explain the PHP2Shell vulnerability in simple words, so that website owners, students and business teams can follow it without a coding background. We also show you how to check your PHP version and how to update PHP to a fixed release.

PHP2Shell at a Glance

  • Name: PHP2Shell (also written as php2shell)
  • CVE IDs: CVE-2026-109618 and CVE-2026-109619. A CVE ID is like a registration number for a security flaw, so that everyone in the world refers to the same problem.
  • Severity: critical, with a CVSS v4.0 score of 9.2 out of 10 from the PHP security team. CVSS is a standard 0 to 10 scale that shows how serious a flaw is.
  • Risk: an attacker can run their own code on the web server without logging in
  • Who is affected: websites and servers running a PHP version that does not have the fix
  • Fixed versions: PHP 8.5.12, PHP 8.4.27, PHP 8.3.36 and PHP 8.2.35
  • Fix released on: 2026-10-21
  • Main advice: update PHP now. The PHP project says there is no complete workaround and that updating is the only safe option.

What Is PHP and Why Should You Care?

PHP is a programming language that works in the background of many websites. When a visitor opens a page, fills in a contact form or places an order, PHP is often the software doing that work on the server.

Popular platforms such as WordPress, Joomla, Drupal, Magento and Laravel are built on PHP. So if your website runs on any of these, it uses PHP, even if you have never seen a single line of PHP code.

Think of it like this: your website is a car and PHP is its engine. Your car may look perfect, but if the engine has a manufacturing defect, every car with that engine is at risk. The makers have now released the repair, but your car is fixed only when you get the repair done at the service centre.

What Is the PHP2Shell Vulnerability?

In cyber security, a shell means the power to run commands on a computer. The name PHP2Shell points to the danger: a flaw inside PHP that can take an attacker all the way to running commands on your web server.

PHP2Shell is made up of two related flaws. Both are memory safety problems in the way PHP handles errors while it is processing a visitor's request, especially when it runs out of memory.

A Simple Way to Understand It

Imagine a shopkeeper who has to pull down the shutter in a hurry because of a sudden power cut. In the rush, a few things are left on the counter and the cash drawer is not locked properly. Now imagine a thief who knows this, causes the power cut on purpose and takes advantage of the confusion.

PHP2Shell works in a similar way. An attacker sends specially crafted requests that push PHP into an error, such as running out of memory. PHP stops its work suddenly, but some pieces of memory are not cleaned up properly. A skilled attacker can then misuse these leftover pieces to make the server run their code.

The Two CVEs in Brief

For readers with a technical background, here is a short summary:

  • CVE-2026-109618: remote code execution linked to how PHP handles out-of-memory errors. After the error, request memory can be left in an unsafe, uninitialised state.
  • CVE-2026-109619: remote code execution linked to stale global state. PHP can keep a pointer to memory that has already been freed, which is a type of use-after-free bug.

Why Good Website Code Does Not Protect You Here

The most important point is this: the problem is inside PHP itself, not in your website's code. According to PHP's advisory, the attack was shown to work against Apache with mod_php without the website's own code doing anything wrong. So even a well-built website can be at risk if the PHP version underneath it is not updated.

CISA, the cyber security agency of the United States government, says these flaws affect all PHP installations that serve web requests. Security researchers note that this includes PHP running through PHP-FPM, Apache with mod_php, PHP-CGI, LiteSpeed and FrankenPHP.

Why PHP2Shell Is Being Treated as a Critical Alert

Several things make this critical PHP vulnerability especially serious:

  1. No login needed. The attacker does not need a username, a password or any access to your website.
  2. Full control is possible. If the attack succeeds, the attacker can run their own code on your server. This can lead to stolen customer data, a hacked or defaced website, hidden malware or your server being used to attack others.
  3. Details leaked early. Information about the flaws became public before the official fix was released, which gave attackers a head start.
  4. Attacks have been reported. Security companies have reported attempts to exploit PHP2Shell, and code that claims to exploit it is being shared online. The full extent of successful attacks is not yet clear.
  5. Government alerts. Agencies such as CISA in the United States, CERT-EU in Europe and the Canadian Centre for Cyber Security have issued alerts asking organisations to patch quickly.

Is Your Website Affected?

Your website is at risk if it runs on PHP and its PHP version is older than the fixed release for its version line. If you are not sure whether your website uses PHP, ask your developer or hosting provider. Then use this simple list:

  • PHP 8.5: fixed in 8.5.12. Versions 8.5.0 to 8.5.11 are affected.
  • PHP 8.4: fixed in 8.4.27. Versions 8.4.0 to 8.4.26 are affected.
  • PHP 8.3: fixed in 8.3.36. Versions 8.3.0 to 8.3.35 are affected.
  • PHP 8.2: fixed in 8.2.35. Versions 8.2.0 to 8.2.34 are affected. PHP 8.2 also reaches end of life on 2026-12-31 and will get no security fixes after that, so plan your move to a newer version.
  • PHP 8.1 and older, including PHP 7 and PHP 5: no official fix has been released. These versions have reached end of life, so you need to upgrade to a supported version.

Note for Linux servers: if PHP was installed from your Linux distribution (for example Ubuntu, Debian, AlmaLinux or Red Hat Enterprise Linux), the version number may look older even after the fix is installed. Distributions often add security fixes to their own packages without moving to the new PHP version number. In that case, follow your distribution's security notice for CVE-2026-109618 and CVE-2026-109619.

How to Check Your PHP Version

You do not need to be a developer for the first three options below.

Option 1: From Your WordPress Dashboard

  1. Log in to your WordPress admin area.
  2. Go to Tools and then Site Health.
  3. Open the Info tab and expand the Server section.
  4. Look for PHP version.

Option 2: From Your Hosting Control Panel

  1. Log in to your hosting control panel, such as cPanel or Plesk.
  2. Look for an option named MultiPHP Manager, Select PHP Version or PHP Settings.
  3. Note the PHP version set for your website.

Some control panels show only the main version (for example 8.3) and not the full number. In that case, ask your hosting provider to confirm that the PHP2Shell fix is installed.

Option 3: Ask Your Hosting Provider or Developer

If you are not comfortable with these steps, simply send a message like this to your hosting provider or developer:

Hello, please confirm that the PHP version used by my website has been
updated to a release that fixes CVE-2026-109618 and CVE-2026-109619
(PHP2Shell). If my website uses PHP 8.1 or older, please help me move
to a supported version. Thank you.

Option 4: For Server Administrators

If you manage the server yourself, check the version from the command line:

php -v

Please remember that the command line PHP and the PHP used by your website can be different. So also check the service that actually runs your website. For PHP-FPM, use the command for your version (on some systems it is simply php-fpm -v):

php-fpm8.3 -v

You can also list the installed PHP packages:

# Ubuntu or Debian
dpkg -l | grep php

# AlmaLinux, Rocky Linux or Red Hat Enterprise Linux
rpm -qa | grep php

If you manage many servers, prioritise the ones that face the internet, especially those running Apache with mod_php.

How to Protect Your Website by Updating PHP

Updating PHP is the real fix for PHP2Shell. Before you start, take a full backup of your website files and database. A backup is your safety net if anything goes wrong.

If You Use Shared or Managed Hosting

  1. Check your current version using the steps above.
  2. If you are on PHP 8.2, 8.3, 8.4 or 8.5, ask your hosting provider to confirm that the October 2026 PHP security update is installed. On shared hosting, the hosting company usually installs PHP updates on its servers.
  3. If you are on PHP 8.1 or older, switch to a supported version from your control panel. Choose the newest version that your theme, plugins and custom code support, ideally PHP 8.3 or newer, because PHP 8.2 reaches end of life on 2026-12-31.
  4. Test your website after the change: home page, login, contact forms and checkout.

If You Manage Your Own Server (VPS or Cloud)

  1. Take a backup or snapshot of the server.
  2. Install the updated PHP packages from your operating system or from the repository you used to install PHP.
  3. Restart PHP and the web server so that the new version is actually loaded. Old PHP processes keep running the old code until they are restarted.
  4. Confirm the version again and test your website.

Example commands for Ubuntu or Debian (change 8.3 to match your version):

sudo apt update
sudo apt upgrade
sudo systemctl restart php8.3-fpm
sudo systemctl restart nginx

If you use Apache instead of Nginx, restart Apache:

sudo systemctl restart apache2

Example commands for AlmaLinux, Rocky Linux or Red Hat Enterprise Linux:

sudo dnf upgrade 'php*'
sudo systemctl restart php-fpm
sudo systemctl restart httpd

Service names can differ from server to server, so adjust these commands to your setup. If you installed PHP from a third-party repository, make sure that repository has published the fixed version. Otherwise, you may still be running a vulnerable build.

If You Use Docker or Containers

Pull the updated official PHP image for your version, rebuild your application images and redeploy every container. A running container keeps its old PHP version until it is replaced.

If You Run PHP on Windows

Download the updated build for your PHP version from the official PHP website, replace the old installation and restart your web server, for example IIS or Apache.

Cannot Update Today? Reduce the Risk Until You Do

Sometimes an update needs a little planning. If you cannot update immediately, take these temporary steps with your hosting provider or technical team:

  • Use a web application firewall (WAF). Several security providers have added firewall rules to block known PHP2Shell attack attempts. A WAF can lower the risk, but it cannot fully fix the flaw.
  • Limit exposure. If a website runs on an old PHP version that cannot be upgraded quickly, consider taking it offline or allowing access only through a VPN until it is upgraded.
  • Follow the official advisory carefully. PHP's security advisory lists some temporary settings for server administrators, but PHP clearly says these are not a complete fix.

Treat these as short-term measures only. Fix a date for the update and stick to it.

After Updating: Check for Signs of an Attack

Updating closes the door, but it does not tell you whether someone entered before you closed it. Since attack attempts were reported even before the fix was released, it is wise to check your website after updating. Look for:

  • New admin or user accounts that nobody in your team created
  • New or changed files that you did not add, especially PHP files inside upload folders (for example, the uploads folder in WordPress)
  • Strange redirects, spam pages, pop-ups or unknown links on your website
  • A sudden rise in PHP memory errors or crashes in your server error logs
  • Unusual outgoing traffic or very high CPU usage
  • Unknown scheduled tasks (cron jobs) on the server

If you find anything suspicious:

  1. Do not panic and do not delete files in a hurry. Logs and files are evidence that help you understand what happened.
  2. Isolate the affected website or server if possible.
  3. Change the passwords and keys for your hosting account, website admin, database and any connected services.
  4. Restore from a clean backup taken before the suspected attack, and make sure the restored website runs a fixed PHP version.
  5. Get help from a qualified incident response or digital forensics professional.

If you run a business or other organisation in India, note that CERT-In's directions require many entities to report certain types of cyber incidents to CERT-In within 6 hours of noticing them. Check with your legal or compliance team whether this applies to you.

Frequently Asked Questions About PHP2Shell

What Is PHP2Shell in Simple Words?

PHP2Shell is the name for two critical flaws in PHP, CVE-2026-109618 and CVE-2026-109619. If a server's PHP version has not been updated, these flaws can let an attacker run their own code on it without logging in.

Is My WordPress Website Affected by PHP2Shell?

WordPress runs on PHP, so your WordPress website can be affected if your server's PHP version does not have the fix. The problem is in PHP, not in WordPress itself, so updating WordPress, themes or plugins alone will not fix it. You need to update PHP.

Which PHP Version Fixes PHP2Shell?

PHP 8.5.12, PHP 8.4.27, PHP 8.3.36 and PHP 8.2.35 contain the fix. Choose the one that matches your current version line, or move to a newer supported version.

Is Changing a PHP Setting Enough?

No. The PHP project says there is no complete workaround. Temporary settings and firewall rules may reduce the risk, but updating PHP is the only full fix.

My Hosting Company Manages My Server. Do I Still Need to Do Anything?

Yes. Ask your hosting company to confirm that the fix is installed, and check that your website is not set to an old PHP version such as 7.4 or 8.1. On many control panels, choosing the PHP version for your website is your own responsibility.

Will Updating PHP Break My Website?

Updates within the same version line (for example, from 8.3.35 to 8.3.36) contain security and bug fixes only, so problems are rare. Moving from an old version such as PHP 7.4 to PHP 8.3 or newer is a bigger change, and older themes, plugins or custom code may need updates. Take a backup and test first, but do not delay the security update.

Is Updating PHP a One-Time Fix?

Updating protects you from the two PHP2Shell flaws, but security is never a one-time job. PHP has also published an advisory about a related issue in its session upload progress feature, which affects even the updated versions and is due to be fixed in PHP's next regular release. Ask your technical team to review that advisory, and keep installing PHP updates on time.

Quick Checklist: What to Do Today

  1. Find out which PHP version your website uses.
  2. If it is older than 8.5.12, 8.4.27, 8.3.36 or 8.2.35 for its version line, update it now.
  3. If you are on PHP 8.1 or older, plan an urgent upgrade to a supported version.
  4. Restart PHP services after updating and confirm the new version.
  5. Check your website for signs of an attack.
  6. Keep regular backups and make PHP updates a routine, not an emergency.

Final Word

PHP2Shell is a reminder that website security is not only about your own code. The software underneath your website matters just as much. The good news is that the fix is available, and for many websites it is a simple update.

At TrojanByte Labs, our advice is clear: update PHP first, check your website next and keep updates on your regular to-do list. If you are unsure about any step, please speak to your hosting provider or a qualified security professional today.

Found This Useful? Share It

https://trojanbyte.com/blog/php2shell-vulnerability-october-2026-critical-alert-what-it-is-and-how-to-protect-your-website

Written By

Vicky Choudhary

TrojanByte Labs tests, investigates and trains from Jaipur. We write about what we see in our work, in plain English.

Need This Looked at Properly?

Our team tests, investigates and trains. Tell us what you are dealing with.

Talk to Us

Redirecting to the Payment Page…

Preparing your secure checkout. It opens in a new tab.

Processing Payment via the Payment Page

Complete the payment in the payment tab.

Please don't press Back or refresh this page until the payment succeeds or fails. It updates by itself.

Your Payment Is Still in Progress

If you go back now, the payment may still go through, and you would have to check its status yourself. Are you sure you want to go back?

This Is Taking Longer than Expected

Check the new tab. If it shows an error or nothing at all, reload this page. No money has been taken.