Skip to main content

php-vuln-check: PHP2Shell checker for servers, Docker images and CI

A PHP vulnerability checker for PHP2Shell (CVE-2026-109618 and CVE-2026-109619). It tells you which of your servers, Docker images and pipelines still run vulnerable PHP, including the distro-backport cases that version-only checks get wrong. One file, no dependencies, and it never sends exploit traffic.

CI OpenSSF Scorecard License: MIT Python 3.6+ Dependencies: none

An open-source project from Ethoic Inc.

Tested on real systems, not only fixtures. CI installs PHP packages in Debian 12 and 13, Ubuntu 20.04 to 24.04, AlmaLinux 8 and 9, Rocky 9, Fedora, Amazon Linux, Alpine and the official php images, runs the tool there, and runs the unit tests on Python 3.6 to 3.13. It was security-reviewed independently before release.

Check your PHP in 10 seconds

pipx install git+https://github.com/ethoic-inc/php-vuln-check
php-vuln-check                 # audit PHP on this server
php-vuln-check images .        # audit Dockerfiles, compose files and Kubernetes manifests

No install needed either. It is a single file with no dependencies, so you can drop it on a server:

curl -fsSLO https://github.com/ethoic-inc/php-vuln-check/releases/latest/download/php_vuln_check.py
python3 php_vuln_check.py

Each release also publishes SHA256SUMS and signed build provenance, so you can verify the file first (gh attestation verify php_vuln_check.py --repo ethoic-inc/php-vuln-check). On Python 3.6 hosts this single file is the way to go; pipx needs a newer Python.

VULNERABLE  php:7.4-apache
            PHP 7.4
            branch 7.4 is end-of-life with no upstream release; pulling a newer image on this branch cannot fix it
            at examples/demo/legacy/Dockerfile:2

VULNERABLE  php:8.3.35-fpm-alpine
            PHP 8.3.35
            8.3.35 is below the fixed release 8.3.36
            at examples/demo/app/Dockerfile:3

REVIEW      php:8.3-cli
            PHP 8.3
            floating tag: resolves to the newest 8.3.x at pull time. Pin it to 8.3.36 or later and rebuild with --pull
            at examples/demo/app/docker-compose.yml:5

PATCHED     php:8.4.27-apache
            PHP 8.4.27
            8.4.27 is the fixed release
            at examples/demo/app/docker-compose.yml:3

Summary: 2 vulnerable | 1 need review | 1 patched

Try it yourself: php-vuln-check images examples/demo.

What PHP2Shell is, and who is affected

PHP2Shell is a pair of critical remote code execution bugs in the PHP engine itself: CVE-2026-109618 and CVE-2026-109619, both rated CVSS 9.2. PHP's own advisories (GHSA-w8hw-w9fx-j79w and GHSA-6wmf-4rv5-p3rp) list every release below 8.2.35, 8.3.36, 8.4.27 and 8.5.12 as affected, and no login is needed. Sansec reports the bugs reach back to PHP 5.4; Apache mod_php and PHP-FPM are the main cases. A fatal error such as running out of memory during a multipart/form-data request leaves freed memory in use.

PHP branch Fixed in What to do
8.6 8.6.0 (first release) nothing
8.5 8.5.12 upgrade (to 8.5.13: see below)
8.4 8.4.27 upgrade
8.3 8.3.36 upgrade
8.2 8.2.35 upgrade
8.1, 8.0, 7.4 no release; PHP published source backports on php-src branches (PHP-8.1-CVE-2026-109618-109619 and the 8.0 and 7.4 equivalents) build from them, use a vendor backport, or move to a supported branch
7.3 and older nothing upgrade

PHP 8.5 also has CVE-2026-129182 (GHSA-2fjv-p558-g82m, critical, CVSS 9.2), a use-after-free in fatal-error backtraces fixed in 8.5.13 (and in 8.6.0). Older branches are not affected. The tool checks it too, so 8.5.12 still fails; until you can update, set fatal_error_backtraces=0 in admin config and restart workers.

Sources: PHP's advisories above are the primary record. Analysis and mitigations: Sansec, Help Net Security, watchTowr. Reports on how widely it is exploited conflict, so patch rather than wait.

What it checks

Command Looks at Confidence
php-vuln-check scan every php, php-fpm, php-cgi, lsphp and Apache libphp*.so on this machine: version, SAPI, owning package, vendor changelog or fixed build, session.upload_progress, memory_limit and fatal_error_backtraces, including PHP-FPM pool overrides high
php-vuln-check images PATH FROM lines in Dockerfiles (with ARG defaults), image: in compose files and Kubernetes manifests high for pinned tags
php-vuln-check images --docker images of running containers high for pinned tags
php-vuln-check images --kubectl images of every pod in the current cluster (--kubectl-args "--context prod") high for pinned tags
php-vuln-check fleet hosts.txt runs scan on every host over SSH, nothing installed there high
php-vuln-check url https://example.com the PHP version a site advertises in X-Powered-By (one normal GET). Never says PATCHED: a banner proves nothing low

Every result is one of:

  • PATCHED: version at or above the fix, the vendor changelog names both CVEs, or the package is at or above a fixed build listed in the vendor's security notice. It describes the files on disk; scan downgrades it to REVIEW when running processes still use a replaced PHP file, and you should restart PHP-FPM or Apache after any update.
  • VULNERABLE: below the fix with no backport evidence, or an end-of-life branch.
  • REVIEW: it cannot tell (floating image tag, digest-pinned image, hidden version, pre-release, a package whose changelog is not installed). Not a clean bill of health.
  • NONE: fleet found no PHP on that host in the standard locations. This is not PATCHED: PHP in a custom prefix, container or vhost folder would not appear.
  • ERROR: an SSH, network or file-reading failure. Unreadable or oversized Dockerfiles are errors, never a silent pass.

Why another PHP2Shell scanner?

Active scanners such as Assetnote's php2shell-scanner answer "does this host fall over when probed?" by deliberately triggering PHP memory exhaustion on the target. Their authors call that risky in nature. php-vuln-check answers a different question, "what do we run and is it patched?", and does it without touching a running service. Use both.

php-vuln-check Active probe scanners
Sends crash-inducing requests never yes, by design
Safe on production yes read their warnings
Knows about distro backports (Debian, Ubuntu, RHEL family) yes, via package changelogs not their job: they test behavior
Audits Dockerfiles, compose and Kubernetes yes no
Audits many hosts at once yes, fleet over SSH per target
CI gate and GitHub code-scanning (SARIF) yes no
Tests whether a host actually fails when probed no yes

How backport detection works

Debian, Ubuntu and RHEL patch PHP without bumping it to 8.2.35, so PHP 8.2.30 on a distro can be safe. For a binary owned by a package, scan reads the vendor changelog (/usr/share/doc/<pkg>/changelog.Debian.gz, or rpm -q --changelog) and treats the host as patched only if both CVE IDs are named.

Docker's ubuntu and debian images strip /usr/share/doc, so there is often no changelog to read. Then scan compares the package version with the fixed builds listed in the vendor's notice (for Ubuntu, USN-8948-1), using dpkg --compare-versions. A fixed build only counts for the same build line, so a Sury 8.3.6-1+ubuntu24.04.1 is never judged against Ubuntu's 8.3.6-0ubuntu0.24.04.13. Debian's fixes are new upstream releases (8.2.35, 8.4.27), which the version check already covers. You can check by hand:

zgrep CVE-2026-109618 /usr/share/doc/php8.2-common/changelog.Debian.gz    # Debian, Ubuntu
rpm -q --changelog php-common | grep CVE-2026-109618                       # RHEL, Alma, Rocky

If a vendor shipped a fix without naming the CVE, you will see a false VULNERABLE. Check the vendor's security advisory, and please open an issue so the lookup can learn that case.

Run it across your whole estate

# hosts.txt: one [user@]host per line, # for comments
php-vuln-check fleet hosts.txt --jobs 16 --format csv -o php-exposure.csv

The script is streamed over SSH (python3 - on the host), so nothing is installed or left behind. You need key-based SSH and Python 3 on each host. Output from the hosts is validated before it is shown. A host where no PHP is found is reported as NONE, not PATCHED.

Gate your pipeline

# .github/workflows/php-check.yml
on: [push, pull_request]
jobs:
  php2shell:
    runs-on: ubuntu-latest
    permissions: { contents: read, security-events: write }
    steps:
      - uses: actions/checkout@v4
      - uses: ethoic-inc/php-vuln-check@v0.2.0
        with:
          fail-on: vulnerable          # or "review" to also fail on floating tags
          sarif-file: php-vuln.sarif
      - uses: github/codeql-action/upload-sarif@v3
        if: always()
        with: { sarif_file: php-vuln.sarif }

Findings show up in your repository's Security tab with the Dockerfile line. To block it earlier, add the pre-commit hook:

# .pre-commit-config.yaml
repos:
  - repo: https://github.com/ethoic-inc/php-vuln-check
    rev: v0.2.0
    hooks:
      - id: php-vuln-check-images

Other CI systems: run php-vuln-check images . --fail-on vulnerable. Exit codes are 0 clean, 1 vulnerable, 2 needs review, 3 error or bad usage (a mistyped path is an error, not a clean scan). Formats: --format text|json|csv|sarif.

Limits

  • It does not test whether a host is exploitable. It tells you whether the PHP on it is patched.
  • images reads tags in your files. It does not open the image, so a FROM line you rebuild later can drift. Pin full versions and rebuild with --pull. A version that comes from an ARG default or a ${VAR:-default} can be overridden by a build argument or .env file, so it can be VULNERABLE or REVIEW but never PATCHED. Digest-pinned references are REVIEW. Third-party images that merely name themselves php are never PATCHED from their tag.
  • Directory scans read Dockerfiles (any Dockerfile*, *.Dockerfile, Containerfile*), COPY --from= images, and *.yml/*.yaml files with image: entries. JSON manifests are read when you pass them by name. Helm values files that split repository and tag are not read yet.
  • SARIF output includes findings that have a file location (the images command), because GitHub code scanning needs one.
  • Config findings (session.upload_progress.enabled, memory_limit, fatal_error_backtraces) come from php -i for that binary. For PHP-FPM, scan also reads php_value / php_admin_value overrides from the pools in the packaging's usual php-fpm.conf and its includes, shown as pool www: memory_limit=-1. A config passed with -y/--fpm-config and .user.ini files are not read. They are hints, not proof, and the partial mitigations they relate to do not replace patching.
  • scan runs php -n -v and php -i only on binaries that are owned by root (or you) and that neither they nor their parent folders are writable by group or others. Anything else, such as a binary under a tenant's home directory, is read statically and never run. --no-exec runs nothing; --exec runs everything it finds. Programs are run with no terminal input, a timeout and capped output.
  • The advisory data is typed in from PHP's and the vendors' notices. Every report warns when it is more than 30 days old; update to the latest release then.
  • Linux and macOS hosts. Windows is not supported yet.
  • Written for Python 3.6+ so it runs on older enterprise hosts. CI runs the tests on 3.6, 3.7 and 3.8 to 3.13, and runs the tool against real PHP packages on Debian, Ubuntu, AlmaLinux, Rocky, Fedora, Amazon Linux, Alpine and the official PHP images. It is a new tool: read the results critically and report anything that looks wrong.

FAQ

Am I vulnerable to PHP2Shell? Run php-vuln-check on the server. If it prints VULNERABLE, the PHP there is below the fix and has no vendor backport. If you only see PATCHED, the version is fixed or the vendor changelog names both CVEs.

Which PHP versions fix CVE-2026-109618 and CVE-2026-109619? 8.2.35, 8.3.36, 8.4.27 and 8.5.12 or later. PHP 8.1 and older get no release. PHP did publish source backports for 7.4, 8.0 and 8.1 on php-src branches; for anything else you need a vendor backport or an upgrade.

Is PHP 7.4 or 8.1 vulnerable? Treat them as vulnerable. PHP's advisories only list 8.2 to 8.5, but Sansec reports the bugs reach back to PHP 5.4 and the PHP project made no release for older branches (it published source backports for 7.4, 8.0 and 8.1 only). They are safe only if your vendor's changelog names both CVEs, or you built from PHP's backport branch, which this tool cannot see.

Does Ubuntu, Debian or RHEL ship a fixed PHP? Often as a backport on an older version number. scan checks the package changelog for both CVE IDs, which is why it can say PATCHED for 8.2.30 on a distro.

How do I check Docker images for PHP2Shell? php-vuln-check images . reads your Dockerfiles, compose files and Kubernetes manifests. php-vuln-check images --image php:8.3-fpm checks one reference, and --docker checks running containers.

Can I scan a website remotely? php-vuln-check url https://example.com reads the advertised X-Powered-By header with one ordinary request. Many sites hide it, a proxy can fake it and backports are invisible from outside, so it only ever reports REVIEW or ERROR. Run scan on the server for a real answer.

Will it crash or slow my server? It sends no exploit traffic. scan reads files and runs php -n -v and php -i on trusted binaries only. --no-exec skips even that.

What do I do if it says VULNERABLE? Update PHP and restart PHP-FPM or Apache. Until then, the partial, temporary mitigations in PHP's advisory are, in its order: enforce memory_limit=-1 in admin config and cap request body size at the web server; set session.upload_progress.enabled=0 (and fatal_error_backtraces=0 on PHP 8.5) and restart every worker; and, only if the application takes no uploads, block multipart/form-data at the web server. See the Sansec write-up for exact snippets.

Does it find other PHP CVEs? Not yet. Advisories are one entry in the ADVISORIES list at the top of php_vuln_check.py, so adding the next one is a small pull request. See CONTRIBUTING.md.

Contributing

Wrong result on your distro, a package manager we should read, or the next PHP advisory: open an issue or a pull request. Start with CONTRIBUTING.md. To report a security problem in this tool, see SECURITY.md. Taking part means following the Code of Conduct.

Questions, press or anything else: hello@ethoic.com.

About Ethoic

Ethoic Inc builds human-centered AI tools. This tool runs on your own machine, has no telemetry and only talks to the hosts you point it at.

Disclaimer

php-vuln-check is an open-source project from Ethoic Inc. It is not affiliated with the PHP Group, Sansec, Assetnote, watchTowr or anyone else named here. It is provided as is under the MIT license. A PATCHED result is evidence about versions and changelogs, not a guarantee. Only check systems you own or are authorized to check.

Metadata

Release files for php-vuln-check 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for php-vuln-check 0.2.0
File Size Uploaded Provenance Actions
php_vuln_check-0.2.0.tar.gz 42.5 kB With provenance Details for php_vuln_check-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for php-vuln-check 0.2.0
File Interpreter ABI Platform Actions
php_vuln_check-0.2.0-py3-none-any.whl Python 3 none any Details for php_vuln_check-0.2.0-py3-none-any.whl

Total release size: 72.9 kB

Release files / php_vuln_check-0.2.0.tar.gz

Download URL php_vuln_check-0.2.0.tar.gz
Size 42.5 kB
Tags Source
SHA-256 checksum
How to use checksums
40159d3511f8e9a9a8400045e8cf5bde18bcd8b6a390ddc765c5a9309c6affa0
BLAKE2b-256 checksum
How to use checksums
4d9b9e50187c9b374a0c542c618d3cdf262c95abe2f22643ea860755efc49ec3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.

Transparency log

Release files / php_vuln_check-0.2.0-py3-none-any.whl

Download URL php_vuln_check-0.2.0-py3-none-any.whl
Size 30.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
78d3ed25ca63b01ff5279f9f5b6f60352cb8ca957ff2bc6cfe0416891272c78b
BLAKE2b-256 checksum
How to use checksums
2965f4e4d0b5bd9ce280437193c7fee9d8c5a6fff7561771e500eaf2f6f181ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.

Transparency log

Security for php-vuln-check 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for php_vuln_check-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page