phpwarden vs. composer audit
composer audit is built into Composer and flags known-vulnerable Composer packages. phpwarden also covers the PHP engine and WordPress, ranks findings by real-world exploitation (CISA KEV + EPSS), and checks reachability. Here's exactly how they differ.
composer audit is free, already in Composer, and
perfect as a first gate on your composer.lock. phpwarden is a superset for PHP specifically: it scans
the same Composer dependencies and your PHP engine version and WordPress install, ranks everything by what
attackers are actually exploiting, and tells you whether a vulnerable package is even reachable in your code. Use
composer audit if Composer dependencies are all you care about; use phpwarden if you want the whole PHP
attack surface prioritised by real risk.Feature comparison
| composer audit | phpwarden | |
|---|---|---|
| Scans composer.lock | ✓ Yes | ✓ Yes |
| Scans the PHP engine version (per branch/SAPI) | ✗ No | ✓ Yes |
| Scans WordPress core / plugins / themes | ✗ No | ✓ Yes |
| Ranks by exploitation (CISA KEV, then EPSS, then CVSS) | ✗ severity label, no exploitation data | ✓ Yes |
| Reachability: is the vulnerable package used in your code? | ✗ No | ✓ Yes |
| Runtime protection (PHP-FPM guard daemon) | ✗ No | ✓ paid: dry-run on Pro, enforce on Team |
| Scans your own PHP code (whole program, framework-aware) | ✗ No | ✓ 89 rules, cross-file |
| Live check of the running site from outside | ✗ No | ✓ read-only, ownership-verified |
| One combined, ranked verdict across all of the above | ✗ No | ✓ phpwarden assess |
| SARIF output for GitHub / GitLab code scanning | ✗ No | ✓ Yes |
| Advisory data freshness | ✓ queries Packagist live | bundled; free weekly update; twice daily on Pro; exploited CVEs within 24 hours |
| Runs offline / no account | ✗ needs the Packagist API | ✓ Yes |
| Cost | Free | Free (engine + community feed) |
| Setup | None: ships with Composer 2.4+ | pipx / composer require / single file |
| CI exit code for pipelines | ✓ Yes | ✓ Yes |
What composer audit does well
composer audit (Composer 2.4+) queries the Packagist Security Advisory API, which aggregates GitHub
Security Advisories and the FriendsOfPHP/security-advisories database, and flags any package in your
composer.json or composer.lock with a known advisory, printing the package, affected range,
severity, a link and the CVE. It exits non-zero with the count of advisories, so it drops straight into CI, and
Composer 2.8+ can also report abandoned packages. It is free, zero-setup, and there is no reason not to run it.
Where phpwarden goes further
- Three surfaces, not one. composer audit only knows about Composer packages. phpwarden also assesses the PHP engine itself, per branch, because PHP backports fixes (8.3.36 is patched, 8.3.35 is not), and scans WordPress core, plugins and themes off disk.
- Exploitation-first ranking. composer audit lists advisories per package with a severity label and has no exploitation data. phpwarden ranks by CISA KEV (confirmed exploited in the wild), then EPSS (probability of exploitation), then CVSS, so the bug attackers are using today sits above a scarier-sounding one nobody touches. Of the 19,580 CVEs in phpwarden's feed, only 54 are in KEV; that's the shortlist a flat severity sort buries.
- Reachability. phpwarden can check whether a vulnerable package is actually referenced in your code before it shouts, cutting noise from dependencies you don't call on a request path.
- Runtime guard. For PHP-FPM hosts, phpwarden has a daemon that watches workers for in-progress memory-corruption exploitation: something no lockfile scanner does. The guard is part of the paid plans (dry-run on Pro, enforce on Team).
- Your own code and the live site.
phpwarden codeanalyses the whole program (types, Composer autoloading, Laravel/Symfony/WordPress models) and follows request data across files into SQL, shell,unserializeand include calls in your own code, andphpwarden probechecks the running site from outside for exposed.envand.gitfiles and debug pages.phpwarden assesscombines all of it into one ranked list with the reason for each item.
One thing composer audit has that the free phpwarden feed does not: it asks Packagist live, so a new advisory shows up the moment it is published. phpwarden's free feed is bundled with each release and updated weekly without a key (a newly exploited vulnerability is released to it straight away); the maintained feed on Pro is rebuilt twice a day.
When to use composer audit instead
If your project is pure Composer with no WordPress and you're happy assessing the PHP engine separately, and you
want the absolute minimum setup, composer audit is already on your machine and covers the dependency case
well. Many teams run both: composer audit as a zero-config gate, and phpwarden for the engine,
WordPress, exploitation ranking and reachability. They draw from overlapping data (both see FriendsOfPHP/OSV), so
phpwarden will flag the same Composer CVEs plus the rest.
Try phpwarden on your project
Zero dependencies, offline, Apache-2.0. Ranks findings by CISA KEV → EPSS → CVSS.
composer require --dev phpwarden/phpwarden # PHP projects → vendor/bin/phpwarden
vendor/bin/phpwarden deps composer.lock # Composer
vendor/bin/phpwarden scan # PHP engine on this host
vendor/bin/phpwarden wordpress /var/www/html # WordPress core, plugins, themes
No Composer? pipx install phpwarden or the single-file phpwarden.pyz. In CI: oroma-alfred/phpwarden-action@v1.