PHP2Shell is the nickname for a set of serious security flaws in the PHP programming language, discovered with the help of advanced AI models and disclosed in October 2026. The flaws sit deep inside the PHP engine, which powers an estimated 70% of websites, including WordPress, Drupal, Magento and Laravel applications. A patch is available from the PHP project, and website owners are being urged to update immediately.
If you only have a minute, here is what matters:
PHP is a server-side scripting language. When you open a WordPress blog, an online store or a booking page, there is a good chance PHP is generating that page behind the scenes. Reports put its share of the web at about 70% of websites, which is why a flaw in PHP itself is a bigger event than a flaw in a single plugin or theme.
Most security problems that website owners deal with live in add-ons: a weak plugin, an old theme, a leaked password. This one is different. According to the researchers, the weaknesses exist at the level of the PHP engine, so they can affect any PHP application running on a vulnerable version, no matter how carefully that application was written. You can have a clean theme, trusted plugins and a strong admin password, and still be exposed if the server underneath is running an unpatched PHP.
That is the reason security teams, governments and businesses around the world reacted so quickly, and why some commentators have started calling this moment "Black October."
Security firm Wiz published a technical write-up that names the issue PHP2Shell and describes four separate bugs it initially reported to the PHP team:
In plain language, "use-after-free" and "type confusion" are classic memory-safety mistakes. They can let an attacker make a program behave in ways its authors never intended. In the worst case, that can mean remote code execution (RCE): running the attacker's commands on your server. The name "PHP2Shell" hints at exactly that outcome, a path from a PHP flaw to a shell, which is a command-line foothold on the machine.
The researchers also said the problem is deeply rooted in the PHP codebase and will need a comprehensive fix, which is why the guidance is to keep installing updates as the PHP project releases them rather than treating one patch as the end of the story.
This is the part of the story that made headlines. Several groups, working separately, discovered pieces of the problem around the same time in August 2026:
OpenAI's president, Greg Brockman, noted that the flaw had been present in PHP for 14 years. The researchers say it had never been exploited before it was found.
One detail from the reporting is worth remembering because it corrects a common assumption: AI did not simply press a button and produce a finished answer. In one account, the AI agent surfaced the flaw but could not explain how it actually worked, and the human researchers spent days untangling the cause and reproducing it. The lesson is that AI dramatically speeds up the search, while human experts are still needed to confirm, explain and safely fix what it finds.
The researchers followed responsible disclosure: report privately, let the PHP team prepare a fix, then publish. The problem was that details leaked online before everyone could patch. According to news coverage, hackers moved in quickly, and attempted exploits surged as the information spread. One startup owner publicly claimed that attackers stole their source code, exposed cookie data and leaked legal documents, although individual claims like this should be treated as reports rather than verified facts.
The broader worry is speed. The same kind of AI tools that help defenders find bugs can help attackers turn a published bug into a working exploit far faster than before. Security leaders quoted in the coverage described it as a race between patching and exploitation, and former CISA director Chris Krebs urged smaller organizations to scan for vulnerabilities constantly, deploy patches promptly, or take legacy systems offline.
Short answer: if your site runs on PHP and you have not updated PHP recently, assume you should check today.
The sites most likely to be in trouble are:
Sites on well-run managed hosting are often safer, because good hosts patch PHP centrally. But "often" is not "always," so confirm instead of assuming.
Security experts quoted in the coverage listed several possible outcomes on an unprotected server:
For a small business, the damage goes beyond downtime. A hacked site can be blacklisted by search engines and browsers, lose rankings, trigger customer-data notification duties under privacy laws, and cost real trust that takes months to rebuild.
You cannot fix what you cannot see, so start by finding out exactly which PHP version your site runs. Use whichever method matches your setup.
Most hosting panels show the PHP version in one or two clicks.
Write down the version for every domain, including subdomains and add-on domains. Different sites on the same account can run different PHP versions.
WordPress shows the PHP version inside the dashboard.
If you have WP-CLI access, you can also run:
wp --info
The output includes the PHP binary and version used by the command line.
If you manage your own server, connect over SSH and run:
php -v
This prints the installed version. One important warning: the command line can use a different PHP than your website does. A server may run PHP 8.x for the command line and a different version for PHP-FPM or Apache, which is what actually serves your pages. Check the web-facing service too, for example with php-fpm -v (the exact command name varies by system), or use the phpinfo method below.
Create a temporary info page. Upload a file called info-check.php to your site with this single line:
<?php phpinfo();
Open it in your browser, note the PHP Version at the top, and delete the file immediately afterwards. A phpinfo page exposes a lot of server detail, so never leave it online.
Open the official PHP website (php.net), read the latest security announcement and release notes, and find the fixed version for your branch. If your branch is listed as no longer supported, you need to move to a supported branch, not wait for a patch.
Be careful with one trap on Linux servers. Distributions such as Ubuntu and Debian sometimes backport security fixes into their own packages without changing the headline version number. That means a version number that looks old may already be fixed, and a version number that looks new is not automatically safe. For distribution packages, check your distribution's security tracker or the package changelog, for example with apt changelog followed by your PHP package name.
Yes, and on shared hosting it is often the quickest route. Send a short message asking: "Have you applied the PHP security patches for the PHP2Shell vulnerabilities on my server, and which PHP version is my account running?" Keep their reply for your records.
The fix is to update PHP to a patched, supported version and restart the services that run it. Follow these steps in order.
Take a full backup of your files and database. Updating PHP is usually safe, but older plugins and themes sometimes break on newer PHP versions, and you want a way back.
On a Debian or Ubuntu server using distribution packages, a typical routine is:
sudo apt update
sudo apt list --upgradable | grep php
sudo apt upgrade
Then restart the PHP service so the new code actually loads. The service name depends on your version, for example:
sudo systemctl restart php8.3-fpm
Replace the version in the command with the one you use, and restart your web server (Apache or Nginx) if your host recommends it. On other systems, use your own package manager or the PHP packages your provider maintains. Updating without restarting is one of the most common mistakes, because the old vulnerable code can stay in memory.
If you deploy with Docker or Kubernetes, update the base image, rebuild without relying on cached layers, redeploy, and confirm the running containers show the new version.
After the update, open your homepage, log in to the admin area, test your forms, checkout and search, and look at the error log. If something breaks, the usual culprit is an old plugin or theme that does not support the newer PHP version. Update or replace that component rather than rolling back to a vulnerable PHP.
While you are at it, update WordPress core, plugins and themes, or your framework and Composer dependencies. Attackers often chain several weaknesses, so a fully patched stack is much harder to break.
Run the version check again using the same method you used before, and confirm that it matches the patched release or that your distribution confirms the fix is included. Do not rely on memory or on a dashboard you have not refreshed.
Patching closes the door, but it does not tell you whether someone walked in earlier. Because details spread before many sites were updated, it is sensible to inspect your site.
find /path/to/your/site -name "*.php" -mtime -30 -ls
Review anything you do not recognize.
find wp-content/uploads -name "*.php"
wp core verify-checksums
wp plugin verify-checksums --all
wp user list --role=administrator
Remove any account you do not recognize.
Treat it as a real incident:
This will not be the last AI-assisted vulnerability. OpenAI itself has said it expects findings like these to increase sharply in the coming months. These habits help you stay ahead of the next one:
Need help checking or securing your website? Picky Vibe can help with website maintenance, security-minded development and SEO. [Add your contact link here.]
PHP2Shell is the name given to a group of critical flaws in the PHP engine found with the help of AI models. They can, in the worst case, let attackers run code on a vulnerable server. A patch is available from the PHP project.
No. It affects sites running on vulnerable, unpatched PHP versions. Sites that do not use PHP, or whose servers are already patched, are not exposed in the same way. Because PHP runs on roughly 70% of websites, a large number of sites needed to check and update.
Not simply by visiting. Security experts quoted in the coverage said ordinary visitors are not automatically compromised. The danger is to website servers and owners, although a hacked site can later be used to attack its visitors.
Find your exact version using your hosting panel, WordPress Site Health, or php -v, then compare it with the fixed versions listed in the official PHP announcement. If your PHP branch is no longer supported, treat it as vulnerable and upgrade to a supported branch.
Updating and restarting is the essential step, but it does not remove anything an attacker may have planted before you patched. Scan for suspicious files and accounts, update your CMS and plugins, and rotate passwords if you find signs of compromise.
Yes, with human help. Researchers at Wiz and Calif, together with OpenAI, used advanced AI models to find and test the flaws, and reports describe significant human effort to understand, reproduce and confirm them.
Start with your hosting provider's support team. If you use a developer or agency, ask them for written confirmation of your PHP version and patch status.