Skip to main content

phpwarden

PHP vulnerability scanner that ranks findings by real-world exploitation, not CVSS. Of about 19,500 PHP vulnerabilities in the feed, 41 are known to be exploited (CISA KEV, as of 2026-11-13). phpwarden puts those first, then sorts by EPSS probability, then CVSS — so a composer.lock with 30 findings tells you which one to fix today.

It scans the PHP engine/FPM version, Composer dependencies and WordPress installs against one bundled, offline advisory feed. Zero runtime dependencies (Python 3.8+), Apache-2.0.

Reproducible benchmark: on four real PHP stacks, phpwarden found 295 of 295 known vulnerabilities, composer audit 286 and OSV.dev 262. Of 297 findings, 100 were rated critical or high and 4 were actually exploited or likely to be; phpwarden ranked each of those first or second in its project. Method, numbers and a script to rerun it: the benchmark write-up.

$ phpwarden deps composer.lock
18 vulnerable package(s) in composer.lock; 0 actively exploited (KEV). Ranked by exploitation risk, then reachability:

  symfony/http-kernel 5.4.0  CVE-2022-24894 medium (CVSS 5.9)  [EPSS 4% (p90)]
      Symfony storing cookie headers in HttpCache
      fixed in: 4.4.50, 5.4.20, 6.0.20, 6.1.12, 6.2.6

  phpmailer/phpmailer 6.1.5  CVE-2020-13625 high (CVSS 7.5)  [EPSS 4% (p90)]
      ...

Surfaces it covers

Surface Command Instead of
PHP engine / FPM CVE exposure scan image & network scanners
Composer dependency CVEs deps Snyk, composer audit
WordPress core, plugin and theme CVEs wordpress Patchstack, Wordfence
WordPress file integrity (wordpress.org checksums, injected files) integrity Wordfence CLI malware-scan (partly)
Exploitation signatures in logs detect SIEM content
WAF blocking rules (PHP-specific) rules the gap a generic WAF leaves
Fleet exposure dashboard report the CNAPP's PHP view
Continuous worker containment phpwarden-guard daemon —

Why it is different

  • Exploitation first. Every advisory with a CVE is joined to CISA KEV (exploited in the wild, used in ransomware) and FIRST EPSS (probability of exploitation). Findings are ordered KEV, then reachability (deps), then EPSS, then CVSS — in the text output, the JSON and the dashboard alike.
  • Version-accurate, per branch. PHP backports fixes per branch, so a flat "you're on 8.3, upgrade" is wrong. phpwarden knows the fixed release for each branch of each engine CVE and compares precisely.
  • It never overclaims. A CVE that needs a specific SAPI (FPM/CGI), OS or configuration is reported as possibly exposed with the exact condition to confirm — not flagged as a certain hit, and not silently dismissed.
  • Offline by default. The feed ships inside the package. Nothing leaves the machine unless you opt in to --report-to or feed update.

Install

composer require --dev phpwarden/phpwarden   # PHP projects → vendor/bin/phpwarden
pipx install phpwarden                       # Python-tooling box
brew install oroma-alfred/tap/phpwarden      # macOS / Linux with Homebrew
python3 phpwarden.pyz scan                   # single file, no install
docker run --rm phpwarden/phpwarden scan --version 8.3.10 --sapi fpm --os linux   # Docker Hub, amd64 + arm64

On modern macOS / Debian / Ubuntu a plain pip install phpwarden into the system Python is blocked by PEP 668; use pipx, or a virtualenv:

python3 -m venv ~/.venvs/phpwarden && ~/.venvs/phpwarden/bin/pip install phpwarden

Docker usage (mounted projects, exit codes, CI, dashboard reporting) is on the image's Docker Hub page.

Use

phpwarden scan                       # assess this host (auto-detects version/SAPI/OS)
phpwarden scan --version 8.3.10 --sapi fpm --os linux
phpwarden deps composer.lock         # Composer dependencies, KEV → reachability → EPSS → CVSS
phpwarden wordpress /var/www/html    # WordPress core, plugins, themes
phpwarden integrity /var/www/html    # tampered or injected files (vs wordpress.org checksums)
phpwarden detect /var/log/nginx/access.log   # exploit signatures in a log
phpwarden rules --format nginx --out php-block.conf   # PHP-specific WAF rules (or modsecurity)
phpwarden report web01.json web02.json --out fleet.html   # aggregate a fleet view
phpwarden feed status                # which feed is active, how many advisories

Every command takes --json. Exit codes are shared across subcommands and built for gating: 0 clean, 1 exposed / vulnerable / signature hits, 2 possibly exposed (scan), 3 PHP version unknown (scan), 4 input error, 5 --report-to upload failed on an otherwise clean run, 64 usage error. Full table: phpwarden --help.

Replacing Wordfence CLI

Wordfence closed new licences for its CLI in October 2026; Free licences stopped working on 2026-10-14 and Premium licences are not renewed. phpwarden runs the same way (on the server, no plugin in the site) and covers:

Wordfence CLI phpwarden Notes
wordfence vuln-scan /path phpwarden wordpress /path Same job, ranked by real-world exploitation; JSON/SARIF and CI exit codes. Also scans Composer and the PHP engine.
wordfence malware-scan /path phpwarden integrity /path Compares core and wordpress.org plugin files with official checksums; flags injected files, PHP in uploads and common backdoor code. Not a signature scanner: premium plugins and themes cannot be verified and are listed as such.
wordfence remediate – Reinstall the flagged component with WP-CLI.
wordfence db-scan – Not covered.

Full guide: https://phpwarden.io/compare/phpwarden-vs-wordfence-cli#replace

Send results to the dashboard

Any scan, deps, wordpress or detect run can post its result to app.phpwarden.io for history across hosts and alerts when a finding you already carry lands in KEV:

phpwarden scan --report-to https://app.phpwarden.io/v1/reports --report-token <token>

The token comes from the project page in the dashboard; it can also be set as PHPWARDEN_REPORT_TOKEN (and the URL as PHPWARDEN_REPORT_URL). Local output is always printed first, so an unreachable dashboard never hides a finding.

In CI

GitHub Actions — the phpwarden action scans composer.lock, a WordPress path and your production PHP version, writes a job-summary table and composer.lock line annotations, can upload SARIF to the Security tab, and can report to the dashboard:

steps:
  - uses: actions/checkout@v4
  - uses: oroma-alfred/phpwarden-action@v1
    with:
      fail-on: exploited      # fail only on CISA-KEV findings; or critical | high | medium | exposed | never
      report-url: https://app.phpwarden.io/v1/reports
      report-token: ${{ secrets.PHPWARDEN_TOKEN }}

fail-on is an input of the action. The bare CLI exits 1 on any vulnerable package; see the templates below for how a job uses that.

GitLab CI / Bitbucket Pipelines — ready-made templates in integrations/gitlab-ci/ and integrations/bitbucket/ install the CLI, keep phpwarden.json as an artifact, fail the job on exit 1 or 2, and forward to the dashboard when a token variable is set.

Laravel — composer require --dev phpwarden/laravel adds php artisan phpwarden:scan (same exit codes, plus --fail-on=exploited); see phpwarden/laravel.

pre-commit — block a vulnerable composer.lock before it is committed:

repos:
  - repo: https://github.com/oroma-alfred/phpwarden
    rev: main        # pin to a tag with `pre-commit autoupdate`
    hooks:
      - id: phpwarden-deps
        # args: ["--no-reachability"]   # faster: skip the reachability pass

Hosts and cron — WP-CLI, Laravel Forge / Ploi, plain cron and systemd timer recipes are in docs/recipes.md.

The feed

The bundled community feed (currently 2026.10.31.2) works forever, offline:

  • ~21,300 advisories: ~8,800 Composer (from OSV.dev and FriendsOfPHP), ~12,300 WordPress (from NVD: plugin, core and theme), and 145 PHP engine/FPM CVEs, including hand-curated entries with per-branch fixed versions, exposure conditions and detection signatures. 19,400+ carry an EPSS score; 42 were in KEV when this feed was built.
  • License-independent by construction. Every source is open or public-domain (OSV, NVD, FriendsOfPHP, CISA KEV, FIRST EPSS). No commercial vendor's feed is used, so coverage cannot be revoked or priced away.
  • Every build passes feedbuilder/check_feed.py (no open-ended range with a known fix, no fixed version inside its own affected range, no duplicate (package|slug, cve)). The feed is assembled by feedbuilder/ from a curated base plus bulk imports and enrichment; curated entries always win.

A phpwarden.io subscription unlocks the maintained channel — new advisories and KEV/EPSS refreshes as they are triaged — via PHPWARDEN_LICENSE=... phpwarden feed update. Without a key, phpwarden runs the community feed and says so.

Curated engine CVEs with detection signatures:

CVE What Scope
CVE-2019-11043 PHP-FPM env_path_info RCE FPM + nginx, config-gated
CVE-2023-3824 PHAR stack overflow RCE any SAPI, untrusted PHAR
CVE-2024-4577 PHP-CGI argument injection Windows + CGI
CVE-2024-8926 / 8927 cgi.force_redirect bypass CGI / FPM
CVE-2024-11236 DB-quoter integer overflow any SAPI
CVE-2026-109618 / 109619 php2shell FPM memory RCE any SAPI

Continuous guard

scan and detect are point-in-time. For always-on containment of in-progress php2shell-class attacks (OOM on a worker, then that worker reused), run phpwarden-guard, which boots in dry-run and never acts until you promote it after a burn-in. See the guard's DESIGN document.

Honest limits

  • The deterministic version census is the reliable backbone; behavioural detection is best-effort and a clean exploit can leave little trace.
  • scan only knows what it can observe. Anything it cannot determine (SAPI, OS, app-level conditions) is reported as possibly exposed, not safe.
  • The KEV count above is a dated snapshot; phpwarden feed status and the bundled feed are the source of truth for the version you run.

License

Open-core. The engine (src/phpwarden/) and the bundled community feed are Apache-2.0 (see LICENSE). The hosted service (saas/, server/) and the maintained feed are proprietary. Full scope in LICENSING.md.

Metadata

Release files for phpwarden 2.1.1

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

Source distribution (sdist)

Source distribution for phpwarden 2.1.1
File Size Uploaded Provenance Actions
phpwarden-2.1.1.tar.gz 2.7 MB Without provenance Details for phpwarden-2.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for phpwarden 2.1.1
File Interpreter ABI Platform Actions
phpwarden-2.1.1-py3-none-any.whl Python 3 none any Details for phpwarden-2.1.1-py3-none-any.whl

Total release size: 5.2 MB

Release files / phpwarden-2.1.1.tar.gz

Download URL phpwarden-2.1.1.tar.gz
Size 2.7 MB
Tags Source
SHA-256 checksum
How to use checksums
38a6c06bb824e06463ddb7fab9c8acd06e3d14d4e40cd411cf13e0866d17bdbf
BLAKE2b-256 checksum
How to use checksums
42d8d70c955055ff80cbac70bd5cd4ede223c1e2e308e93551f7f9c1bd0eae84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0

Release files / phpwarden-2.1.1-py3-none-any.whl

Download URL phpwarden-2.1.1-py3-none-any.whl
Size 2.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
1066bbcea488448fc463fd41347b607885ede01836f76a1e99374d18a3eb2e5d
BLAKE2b-256 checksum
How to use checksums
fbaee08bfe56cd5d0239039d6ad744e83cad185437e9f86049f046cd56cd38c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.0

Security for phpwarden 2.1.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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