DevWorkspace Pro

How to fix the vulnerabilities that composer audit finds

Composer has no audit fix command. Update every vulnerable package with one tested command, or find and fix them in DevWorkspace Pro with one click.

Updated 3 min read
On this page
  1. Update the vulnerable packages with Composer
  2. What composer audit does not show yet
  3. Fix them in DevWorkspace Pro
  4. Many Composer projects
  5. Limits
  6. Learn more

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-dependencies changes 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 new composer.lock.
  • The constraints in composer.json still apply. If they do not allow the fixed version, the package stays vulnerable. A fix in a new major version needs composer 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.

Health, Security tab of a Laravel project in DevWorkspace Pro: 33 findings, 2 High, 16 Medium, 2 Low and 13 Unknown, with laravel/framework rows marked not reviewed and a Fix 7 safe updates button.
The rows marked "not reviewed" come from the GitHub repository of the package. composer audit did not show them.

Fix them in DevWorkspace Pro

  1. Open the project and go to Health › Security. The app reads composer.lock and your npm lockfile, and checks the exact versions.
  2. Click Fix N safe updates. The app makes one composer update command for all patch and minor fixes.
  3. Click Run command. When the command finishes, the app checks the project again.
The Fix all safe updates dialog with one composer update command for laravel/framework, laravel/pint and five Symfony packages, and the version change of each package.
Nothing runs until you confirm.

On our test project, the 33 findings were in 7 packages. One command fixed all of them.

The Security tab after the upgrade: 7 packages fixed and no known vulnerabilities.
composer audit on the same lockfile then reported no advisories.

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:

One Medium finding for laravel/pint v1.32.1, an arbitrary file write fixed in 1.32.2, published by the maintainer and not reviewed yet, with the composer update command for it.
composer audit reported no advisories for this lockfile.

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

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.

Related

All guides

DevWorkspace Pro

One workspace for every project

Files, Git, GitHub, AI agents, the terminal and your runtimes in one desktop app. Works with every project folder.

macOS Windows Linux