- Accueil
- Vulnérabilités
- CVE-2026-40176
CVE-2026-40176
Composer is vulnerable to Command Injection via Malicious Perforce Repository
Résumé
Composer is a dependency manager for PHP. Versions 1.0 through 2.2.26 and 2.3 through 2.9.5 contain a command injection vulnerability in the Perforce::generateP4Command() method, which constructs shell commands by interpolating user-supplied Perforce connection parameters (port, user, client) without proper escaping. An attacker can inject arbitrary commands through these values in a malicious composer.json declaring a Perforce VCS repository, leading to command execution in the context of the user running Composer, even if Perforce is not installed. VCS repositories are only loaded from the root composer.json or the composer config directory, so this cannot be exploited through composer.json files of packages installed as dependencies. Users are at risk if they run Composer commands on untrusted projects with attacker-supplied composer.json files. This issue has been fixed in Composer 2.2.27 (2.2 LTS) and 2.9.6 (mainline).
Aucune traduction française : description d’origine affichée.
Produits et versions affectés
composer (1 ligne(s))
| Produit | Versions | Corrigé dans | Source |
|---|---|---|---|
| composer | Versions non précisées | — | CNA (éditeur ou attributeur) |
Getcomposer (2 ligne(s))
Packagist (2 ligne(s))
| Produit | Versions | Corrigé dans | Source |
|---|---|---|---|
| composer/composer | de 2.3.0 (inclus) à 2.9.6 (exclu) |
2.9.6 |
GitHub Advisory |
| composer/composer | de 1.0.0 (inclus) à 2.2.27 (exclu) |
2.2.27 |
GitHub Advisory |
Correctif
Mise à jour — Packagist/composer/composer 2.9.6; Packagist/composer/composer 2.2.27source officielle
Source : GitHub Advisory
Contournement
Aucun contournement renseigné.
Savoir si vous êtes touché
Aucune méthode de vérification renseignée.
Chronologie
- — Publication de la CVE (cve)
Avis CERT-FR
- GHSA-wg36-wvj6-r67p — Composer has a command injection via malicious perforce repository 14 avr. 2026
Références
- https://github.com/composer/composer/releases/tag/2.9.6WEB
- https://github.com/composer/composer/security/advisories/GHSA-wg36-wvj6-r67pWEB
- https://access.redhat.com/errata/RHSA-2026:8165WEB
- https://access.redhat.com/security/cve/CVE-2026-40176WEB
- https://bugzilla.redhat.com/show_bug.cgi?id=2458828WEB
- https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-40176.jsonWEB
- https://github.com/FriendsOfPHP/security-advisories/blob/master/composer/composer/CVE-2026-40176.yamlWEB
- https://github.com/composer/composer/releases/tag/2.2.27WEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-40176ADVISORY
- https://github.com/composer/composerPACKAGE
Provenance des données
- Statut
- NVD
- Date de publication
- NVD
- Description
- CNA (éditeur ou attributeur)
- Score CVSS
- CNA (éditeur ou attributeur)
- Faiblesse (CWE)
- CNA (éditeur ou attributeur)
- Vecteur CVSS
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H(CVSS 3.1, CNA:security-advisories@github.com)- Faiblesse
- CWE-20 · Validation d'entrée (générique)