Introduction
LockGuard is a command-line tool that scans PHP project dependencies for known security vulnerabilities. It reads a composer.lock file, queries the official Packagist Security Advisories API, and reports any packages whose installed versions match a published advisory.
Why use it
If you manage a PHP project — Laravel, Symfony, Drupal, WordPress plugin, or anything else using Composer — your composer.lock pins exact versions of sometimes hundreds of packages. Security advisories are published regularly, but checking them manually is tedious and easy to forget. LockGuard automates the check in a single command.
It is designed for two contexts:
- Local development — run it before deploying to catch vulnerable dependencies.
- CI pipelines — run it on every push or pull request. The JSON output and documented exit codes make it scriptable.
What it does
- Reads
composer.lock(or a path you specify). - Combines
packagesandpackages-devsections, deduplicates, and sorts. - Sends package names to the Packagist Security Advisories API in small batches.
- Matches each installed version against advisory constraints using Composer-compatible semantics (caret, tilde, wildcards, ranges, OR, hyphens, stability flags).
- Filters findings by severity threshold.
- Outputs a text or JSON report.
- Returns an exit code:
0for clean,1for vulnerabilities found,2for errors.
What it does not do
LockGuard is an audit tool, not a remediation tool. It will not:
- Modify your
composer.lockor runcomposer update. - Suggest which version to upgrade to (though the
affected_versionsfield tells you the vulnerable range). - Cache results or run offline.
- Scan containers, repositories, or non-Composer projects.
- Send alerts or integrate with notification systems.
These are deliberate scope boundaries for the initial release. The tool does one thing: tell you what's vulnerable and why.
Dependencies
LockGuard is a standalone Rust binary. It does not require PHP, Composer, or any runtime service on your machine. The only network call is to packagist.org for advisory data.
The project depends on composer-semver for version constraint matching. This crate is a faithful port of PHP's Composer semver library, so matching behavior matches what Composer itself would evaluate.