On this page
Composer has no audit fix command, so you fix each package that composer audit reports with composer update <package> --with-all-dependencies. DevWorkspace Pro, a desktop app for macOS, Windows and Linux, does this for you: it lists each vulnerable package with its fixed version and updates all the patch and minor fixes in one step. It costs $9 a month, $95 a year or $499 once.
npm has npm audit fix. Composer users ask for the same thing in composer/composer#12989, which is still open: "Running composer audit and manually copy and pasting all affected packages to run a composer update is rather cumbersome." The request also says the work is worse with many Composer projects, because you repeat it in each one.
Update the vulnerable packages with Composer
This command reads the package names from the audit and updates them in one run. When the audit is clean, it does nothing.
composer audit --locked --format=json \
| php -r 'echo implode("\n", array_keys(json_decode(stream_get_contents(STDIN), true)["advisories"]));' \
| xargs -r composer update --with-all-dependencies
We tested it with Composer 2.10.3 on a Laravel 12 project, in zsh and in bash. composer audit reported 14 advisories in 6 packages. After the command, it reported "No security vulnerability advisories found."
Three things to know:
--with-all-dependencieschanges more than the 6 packages. It also updates the packages they need. In our test, 32 packages changed. Run your tests before you commit the newcomposer.lock.- The constraints in
composer.jsonstill apply. If they do not allow the fixed version, the package stays vulnerable. A fix in a new major version needscomposer require <package>:^<version> --with-all-dependencies. Read the upgrade guide of the package first. - The audit is only as new as Packagist. See the next section.
A third-party plugin, innobrain/composer-fix, adds a fix command to Composer. We did not test it.
What composer audit does not show yet
composer audit gets its advisories from Packagist. A maintainer advisory on GitHub gets there only after GitHub reviews it, and that can take some days.
In November 2026, the Laravel team published 23 advisories in the laravel/framework repository on GitHub. On 27 November, composer audit on our test project reported 1 advisory for laravel/framework v12.70.2. DevWorkspace Pro showed 33 findings: the same 14, plus 19 that the Laravel and Pint maintainers published and GitHub had not reviewed yet. Two of those are High.
Fix them in DevWorkspace Pro
- Open the project and go to Health › Security. The app reads
composer.lockand your npm lockfile, and checks the exact versions. - Click Fix N safe updates. The app makes one
composer updatecommand for all patch and minor fixes. - Click Run command. When the command finishes, the app checks the project again.
On our test project, the 33 findings were in 7 packages. One command fixed all of them.
A major upgrade is not part of the safe updates, because it can break your code. The dialog lists it under Not included. Click Send to AI there to let your AI coding agent read the upgrade guide, make the code changes and run your tests, or click Upgrade on its row.
The Composer command in the first section leaves unreviewed advisories in place. On our project, it did not update laravel/pint v1.32.1:
Many Composer projects
The app checks every project in the background, daily by default, and shows a notification when a check finds a new vulnerability. Each project with findings gets a shield icon in the projects sidebar and on its dashboard card. You do not have to run the audit in each folder.
Limits
- Not a CI gate. The app checks your local projects. In CI, keep
composer audit: it exits with code 1 when it finds an advisory. - Unreviewed advisories cover direct dependencies on GitHub only. The app reads the GitHub repository of each direct dependency, with no GitHub token. When it reaches its part of the GitHub request limit, it checks the rest later.
- A transitive package can stay vulnerable. Its fix can need an update of the package that requires it. The row then shows Still vulnerable.
Learn more
- Dependency Security in the docs
- Lockfile vulnerability checker: check one
composer.lockin your browser, free - Pricing
FAQ
Frequently asked questions
Does Composer have an audit fix command like npm audit fix?
No. composer audit only reports advisories. A request for a fix command (composer/composer issue 12989) is still open. You update each vulnerable package with composer update <package> --with-all-dependencies.
How do I update all the packages that composer audit reports?
Read the package names from composer audit --locked --format=json and pass them to composer update --with-all-dependencies. The full command is on this page. It does nothing when the audit is clean.
Why is a package still vulnerable after composer update?
The version constraint in composer.json can stop the update. If the fix is only in a new major version, run composer require <package>:^<version> --with-all-dependencies and read the upgrade guide of the package first.
Why does composer audit not show an advisory that is on GitHub?
composer audit reads the advisory data from Packagist. An advisory that a maintainer publishes on GitHub gets there only after GitHub reviews it, and this can take some days. DevWorkspace Pro also reads the advisories on the GitHub repository of each direct dependency.
Can the Composer cooldown policy stop a security fix?
Yes. When you set a cooldown period (Composer 2.11 and later), Composer does not install a release that is newer than the period, and a security release is often new. Add the package to the ignore list of the cooldown policy to get the fix now.