PHP2Shell scanner

A free, local checker for CVE-2026-109618 and CVE-2026-109619 on Linux servers you administer. Tool version 1.0.0 · CVE data 2026-10-22.

What is PHP2Shell?

PHP2Shell is the name for two critical bugs in PHP core, CVE-2026-109618 and CVE-2026-109619 (CVSS v4.0 9.2), disclosed on 21 October 2026. They are use-after-free bugs that can lead to unauthenticated remote code execution. The fixes are in PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35.

Read more: PHP Foundation advisory · CERT-EU 2026-018

What the script does

Needs bash 4.3 or newer. A scan works without root; --fix, --workarounds and --rollback need root. Exit code 0 means no PHP or everything is patched, 1 means something is vulnerable or only mitigated. Exit 0 does not mean the host was checked for a past break-in. The full flag list is in the README.

What it changes

Nothing, unless you pass --fix or --workarounds and answer y. Add --dry-run to see the plan without writing anything. The script never sends data anywhere.

Download

Download php2shell.sh View source on GitHub

SHA-256 (from CHECKSUMS.txt):

f69b7f32370d7439e79458570776d68105c1b825d095d4b50f4a511ad3ba6db3

Verify before running

Download, check, read, then run. Please don't pipe the download straight into a shell.

cd /tmp
curl -fsSL -o stacutis-php2shell.sh https://www.stacutis.com/php2shell.sh
curl -fsSL -O https://www.stacutis.com/CHECKSUMS.txt
sha256sum -c CHECKSUMS.txt      # must print: stacutis-php2shell.sh: OK
less stacutis-php2shell.sh      # read it first
sudo bash stacutis-php2shell.sh # scan only; changes nothing

If a menu appears, option 4 leaves the server as it is. The checksum catches a broken download, not a replaced repository, since both files live together.

Disclaimer

Provided as-is, without warranty. Run it only on servers you own or administer. Take a backup before you answer yes to any change. Released under the MIT License.