PortGate

Advisories · PHP & Laravel

CVE-2021-29472 High CVSS 8.8

Composer command injection

Disclosed 2021 · Last reviewed 2 Dec 2026

A composer command that talked to a Mercurial repository could be tricked into running a command from the repository URL.

What happened

The Mercurial driver built a command line from a URL without enough quoting.

Affected and patched versions

Affected
Composer before 2.0.13 and 1.10.22.
Patched
Composer 2.0.13, 1.10.22, and later 2.x.

How to check your server

Check

composer --version

How to fix and harden

  1. Run composer --version.
  2. Upgrade Composer. Current 2.x is far past 2.0.13.
  3. Do not point composer at untrusted VCS URLs.

Fix

composer --version

Sources

Version ranges and fixes follow the vendor advisory. When a distribution backports a fix, trust its security tracker over the upstream version number. New advisories: RSS · JSON