Free security runbook · PHP2Shell

PHP2Shell: patch it, prove it, then look for shells

Two critical PHP core vulnerabilities, CVE-2026-109618 and CVE-2026-109619, allow unauthenticated remote code execution in PHP-FPM, Apache mod_php, php-cgi, FrankenPHP and LiteSpeed. PHP shipped emergency patches on 2026-10-21; CISA added both to KEV on 2026-10-26.

This page is free. It covers detection, how to prove the patch actually reached every pool and container, what to do while you roll out, and what to check afterwards. It contains no exploit code.

Scope: post-disclosure, no live reproduction
Reviewed 2026-11-09 against the PHP security release and the sources in the appendix. Commands are read-only; version strings vary by distro. Verify against your vendor advisory before acting.
What happened

Two core bugs, one name, a very short patch window

CVE-2026-109619

Use-after-free in PHP's upload-progress feature. Reachable before application code runs on some SAPIs.

CVE-2026-109618

Memory corruption triggered in an out-of-memory context. Also remote and unauthenticated on affected builds.

Who is exposed

Public web requests served by PHP-FPM, mod_php, php-cgi, FrankenPHP or LiteSpeed. A CLI-only PHP install has no remote attack surface, but still needs the update.

Why it matters

Pre-auth RCE on the component that runs every request. Exploitation is conditional, not impossible; the patch is the only complete fix.

Detect

Are you exposed? Ask the running process, not the package list

A patched package on disk does not prove the FPM pool or container is running it. Check both.

CommandWhat it tells you
php -vCLI version and build date. CLI is not the web SAPI.
php-fpm -vThe FPM binary version. Run it as the same user/service that serves traffic.
php -r 'echo PHP_SAPI, PHP_EOL;'Which SAPI you are actually invoking. Repeat inside the container or vhost context.
systemctl list-units 'php*' --allEvery PHP service on the host, including pools you forgot about.
docker ps --format '{{.Names}} {{.Image}}'Containers that may ship their own PHP, independent of the host package.
docker image inspect <image> --format '{{.Id}} {{.RepoDigests}}'The actual digest, not the tag. A rebuilt tag can still point at an old layer.
Read the vendor advisory, not just the version string
Distros backport fixes without changing the upstream version. A build dated on or after 2026-10-21 may be fixed even if php -v still says 8.3.x. Confirm with your distro's security advisory and package changelog.
Patch

Prove the patch reached every pool

1. Update the package

Use the distro security channel (apt, dnf, apk) or rebuild the image from a patched base. Do not mix an upstream tarball with a distro layout.

2. Restart the real service

Package upgrade does not restart FPM. Restart every unit and container, then check ActiveEnterTimestamp to prove it actually restarted.

3. Re-check inside the runtime

Run the version check inside the container and as the FPM user. The host binary and the pool binary can differ.

4. Rebuild, do not retag

If the image is built in CI, pin the patched digest and redeploy. Retagging an old image is how the same hole comes back next week.

Contain

If you cannot patch today

These reduce exposure. None of them replaces the patch.

Put the edge in front of every origin
A WAF or virtual patch only helps if traffic cannot reach the origin directly. Close public ports and allow only your edge provider.
Do not rely on disabling one feature
Turning off upload progress may reduce one path; it is not a fix for the other CVE. Treat it as extra time, not safety.
After

Check for persistence, not just the version

If the host was exposed before patching, a clean php -v does not mean it is clean.

CheckWhy
Recently modified *.php files outside deploysWebshells and dropped payloads usually appear as new or changed PHP files.
Unexpected cron jobs and systemd unitsPersistence often survives a package upgrade.
authorized_keys and new local usersAttacker access that does not depend on the PHP hole.
Outbound connections from the web hostBeaconing or data transfer after compromise.
Rotate secrets and keysAssume credentials readable by the web user were exposed.

Preserve logs before cleanup. If you suspect compromise, treat it as an incident, not a patch task.

FAQ

Questions people ask after the advisory

I run WordPress. Am I affected?

Only if the site's PHP SAPI and build are affected. Check the running FPM/mod_php version and the distro advisory; do not assume the CMS version tells you.

I patched, but php -v looks the same.

That is normal for distro backports. Confirm the package changelog and build date, and check the running process inside the container or pool.

Is CLI PHP exposed?

Not remotely through this bug. Update it anyway so a later local path or another component cannot use it.

Does this page replace the vendor advisory?

No. It is a free operational briefing. The PHP release notes, CISA alert and your distro advisory are the authority.

Going deeper on operations?

This page is free. The paid runbooks cover the operational failures around it: deploys that lie, caches that hide changes, and production defaults that only bite on a real domain.

Free page, no checkout. Paid runbooks are $9.99 each; bundles from $19.99.