製品・ソフトウェアに関する情報
Composerにおける複数の脆弱性
Title Composerにおける複数の脆弱性
Summary

ComposerはPHPの依存関係マネージャーです。バージョン1.0から2.2.26および2.3から2.9.5には、Perforce::generateP4Command()メソッドにコマンドインジェクションの脆弱性が存在します。このメソッドは、ユーザーから提供されたPerforce接続パラメータ(ポート、ユーザー、クライアント)を適切にエスケープせずにシェルコマンドを構築します。攻撃者は、悪意のあるcomposer.jsonでPerforce VCSリポジトリを宣言することで、これらの値を通じて任意のコマンドを注入可能であり、PerforceがインストールされていなくてもComposerを実行しているユーザーのコンテキストでコマンドが実行されます。VCSリポジトリはルートのcomposer.jsonまたはcomposerの設定ディレクトリからのみ読み込まれるため、依存パッケージとしてインストールされたパッケージのcomposer.jsonファイルを通じてこの脆弱性が悪用されることはありません。ユーザーは、攻撃者が提供したcomposer.jsonファイルを含む信頼できないプロジェクトでComposerコマンドを実行する際にリスクがあります。この問題はComposer 2.2.27(2.2 LTS)および2.9.6(メインライン)で修正されました。

Possible impacts 当該ソフトウェアが扱う全ての情報が外部に漏れる可能性があります。 また、当該ソフトウェアが扱う全ての情報が書き換えられる可能性があります。 さらに、当該ソフトウェアが完全に停止する可能性があります。 そして、この脆弱性を悪用した攻撃の影響は、他のソフトウェアには及びません。 
Solution

正式な対策が公開されています。ベンダ情報を参照して適切な対策を実施してください。

Publication Date April 15, 2026, midnight
Registration Date April 27, 2026, 11:19 a.m.
Last Update April 27, 2026, 11:19 a.m.
CVSS3.0 : 重要
Score 7.8
Vector CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Affected System
Composer
Composer 1.0.0 から 2.2.26
Composer 2.3.0 から 2.9.5
CVE (情報セキュリティ 共通脆弱性識別子)
CWE (共通脆弱性タイプ一覧)
ベンダー情報
その他
Change Log
No Changed Details Date of change
1 [2026年04月27日]
  掲載
April 27, 2026, 11:19 a.m.

NVD Vulnerability Information
CVE-2026-40176
Summary

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).

Publication Date April 16, 2026, 6:17 a.m.
Registration Date April 17, 2026, 4:12 a.m.
Last Update April 26, 2026, 3:24 a.m.
Affected software configurations
Configuration1 or higher or less more than less than
cpe:2.3:a:getcomposer:composer:*:*:*:*:*:*:*:* 1.0.0 2.2.26
cpe:2.3:a:getcomposer:composer:*:*:*:*:*:*:*:* 2.3.0 2.9.5
Related information, measures and tools
Common Vulnerabilities List