Is your Docker container affected by php2shell?
php2shell is the name for two bugs in PHP, CVE-2026-109618 and CVE-2026-109619. They let someone run commands in your container by sending it a web request, with no login. Attackers have used them since October 2026, and they're on CISA's list of exploited bugs.
The bug is in PHP and not in the app, so updating WordPress or a plugin from its admin page doesn't fix it. In Docker, PHP comes with the image, so you need a newer image.
PHP says the risk is highest with Apache, which the default WordPress and Nextcloud images use. PHP-FPM and FrankenPHP are affected too.
Check all your containers
Run this on the Docker host. It prints the PHP version of every running container that has PHP:
for c in $(docker ps --format '{{.Names}}'); do
v=$(docker exec "$c" sh -c '
for p in php /usr/bin/php[0-9]* /usr/sbin/php-fpm*; do
command -v "$p" >/dev/null && "$p" -v && exit
done' 2>/dev/null | head -n 1)
[ -n "$v" ] && echo "$c: $v"
done
Compare what you see with this table:
| PHP | php2shell is fixed in | Better, has newer fixes too |
|---|---|---|
| 8.6 | All versions | 8.6.0 |
| 8.5 | 8.5.12 | 8.5.13 |
| 8.4 | 8.4.27 | 8.4.28 |
| 8.3 | 8.3.36 | 8.3.37 |
| 8.2 | 8.2.35 | 8.2.36 |
| 8.1 and older | No fixed release from PHP | Move to a newer PHP |
The last column is from November 19, when PHP fixed more critical bugs. Those need unusual settings, but there's no reason to stop at the October version.
Ubuntu and some other distros fix the bug without changing the version number. If the PHP in your image comes from Ubuntu, check Ubuntu's page for the fixed package.
If it was open to the internet, look before you update
Updating replaces the container, and that deletes some of the traces. First list every file that changed since the container was created:
docker diff wordpress
Logs, caches and files ending in .pid are normal. Scripts or programs you don't know in
/tmp are not.
docker diff doesn't show volumes, so check those too. On WordPress, the uploads folder
should have almost no PHP files:
docker exec wordpress find /var/www/html/wp-content/uploads -name '*.php'
Also look for admin accounts you didn't create. Finding nothing doesn't prove that nobody got in. Datadog's write-up lists more signs.
If you do find something, stop the container, restore its volumes from a backup made before October 17 and change every password and key it had, including the database password in your compose file. October 17 is the first day attacks were seen.
Update the container
docker compose pull
docker compose up -d
If you build the image yourself, run docker compose build --pull and then
docker compose up -d. Then run the check again. A pulled image does nothing until the
container is created again, so check the container and not the image.
If the version is still old
Your tag probably doesn't get updates anymore. Your auto-updater will say these are up to date, and they still have the bug:
| Image | PHP inside | Last built |
|---|---|---|
nextcloud:31 | 8.3.30 | March 2026 |
wordpress:php8.1-apache | 8.1.34 | December 2025 |
php:8.1-apache | 8.1.34 | December 2025 |
php:7.4-apache | 7.4.33 | November 2022 |
Move to a tag that's still updated, like nextcloud:32 or
wordpress:php8.3-apache. Nextcloud can only go up one major version at a time, so make a
backup and don't skip any.
I checked the latest tag of these images on December 2, 2026, and all of them have the fix:
WordPress, Nextcloud, phpMyAdmin, FreshRSS, Matomo, MediaWiki, Firefly III, Roundcube, PrivateBin,
Kanboard, DokuWiki, and LinuxServer's BookStack, Grocy and Nextcloud.
If you can't update yet
Take the container off the internet. Stop it, or only allow access over a VPN like WireGuard or Tailscale. PHP also lists settings that block some of the attacks, but says they don't make it safe.
A container that only your home network can reach is much less urgent. Update it anyway, because any device on your network could be used to reach it.
Hear about the next one sooner
PHP published the fix on October 21. The bug only reached CISA's list on October 26, so an alert that waits for that list comes five days late.
exploitwatch, the tool this site is about, reads PHP's own advisories every hour. It's free and runs next to your containers. This is the alert for a container with the old PHP that's open to the internet:
You can try the live demo or get it on GitHub. If you'd rather use a short script, see how to get CVE alerts on your phone.