首选的 PHP IDE,对 Laravel 及其生态系统提供广泛的开箱即用支持。

Composer 2.9.6 Fixes Two Perforce Command Injection Vulnerabilities

发布日期 经过

Composer 2.9.6 Fixes Two Perforce Command Injection Vulnerabilities image

Composer has released version 2.9.62.2.27 LTS to address two command injection vulnerabilities in its Perforce VCS driver: CVE-2026-40261CVE-2026-40176

Please immediately update Composer to version 2.9.6 or 2.2.27 (LTS) by running composer.phar self-update. The new releases include fixes for two command injection security vulnerabilities in the Perforce VCS driver. CVE-2026-40261 was reported by Koda Reef and CVE-2026-40176 was reported by saku0512.

To the best of our knowledge, neither vulnerability has been exploited prior to publication.

The vulnerabilities are located in Composer's Perforce VCS driver and involve insufficient escaping of values used in shell command construction.

Vulnerability Details

The first issue, CVE-2026-40176 , affects the Perforce::generateP4Command() method. It can be exploited if a malicious project includes attacker-controlled Perforce connection parameters such as the port, user, or client in a root composer.json file. This is limited to the root project configuration or Composer config, not dependency package composer.json 文件。

The second issue, CVE-2026-40261 , impacts the Perforce::syncCodeBase() method. It allows command injection via a crafted source reference. This can occur when installing or updating dependencies from a malicious or compromised Composer repository, especially when using source installs like --prefer-source (default for dev versions). Notably, Perforce does not need to be installed for the injected command to be attempted.

Mitigation and Recommendations

The Composer team recommends updating immediately and both issues are fixed in Composer 2.9.6 (mainline) and 2.2.27 (2.2 LTS):

作曲家 self-update

Additional mitigation steps include:

  • Prefer distribution installs: --prefer-dist 或者 preferred-install: dist
  • Avoid untrusted Composer repositories
  • 审查 composer.json before running Composer on unfamiliar projects

Packagist reports that scans of Packagist.org and Private Packagist found no evidence of exploitation. As a precaution:

  • Perforce source metadata publication on Packagist.org was disabled on April 10, 2026
  • The Perforce VCS driver has been disabled on Private Packagist since that date

At the time of disclosure, there is no indication that these vulnerabilities were exploited in the wild.

If you rely on Composer in local development, CI pipelines, or automated workflows, you should verify your version and upgrade to a patched release as soon as possible.

Read their 完整公告 详情请见此处。

埃里克·L·巴恩斯摄

Eric 是 Laravel News 的创建者,自 2012 年以来一直报道 Laravel 相关内容。

归档于:
立方体

Laravel 时事通讯

加入超过 4 万名开发者的行列,不错过任何新的技巧、教程等内容。

图像
SerpApi

适用于您的 LLM 和 AI 应用的 Web 搜索 API

访问 SerpApi
Tinkerwell 徽标

廷克威尔

Laravel 开发者必备的代码运行器。可在本地和生产环境中体验 AI、自动补全和即时反馈功能。

廷克威尔
几天内即可获得 Laravel 代码审查徽标的专家指导

几天内即可获得 Laravel 代码审查方面的专家指导

专家级代码审查!两位拥有 10 年以上 Laravel 开发经验的开发者将为您提供清晰、实用的反馈,帮助团队构建更优质的应用程序。

几天内即可获得 Laravel 代码审查方面的专家指导
PhpStorm 标志

PhpStorm

首选的 PHP IDE,对 Laravel 及其生态系统提供广泛的开箱即用支持。

PhpStorm
Laravel Cloud 标志

Laravel 云

轻松创建和管理服务器,并在几秒钟内部署 Laravel 应用程序。

Laravel 云
了解 Softtech 的标志

了解软科技

Acquaint Softtech 提供 AI 就绪的 Laravel 开发人员,48 小时内即可上手,每月费用为 3000 美元,没有冗长的销售流程,并提供 100% 退款保证。

了解软科技
Kirschbaum 标志

樱桃树

提供创新和稳定性,确保您的Web应用程序取得成功。

樱桃树
Shift 标志

转移

还在运行旧版本的 Laravel?立即实现 Laravel 自动升级和代码现代化,让您的应用程序保持最新状态。

转移
鱼叉:新一代时间跟踪和发票标志

Harpoon:新一代时间跟踪和发票系统

新一代时间跟踪和计费软件,帮助您的机构规划和预测盈利的未来。

Harpoon:新一代时间跟踪和发票系统
Lucky Media 标志

幸运传媒

Get Lucky Now——拥有十余年经验的 Laravel 开发理想之选!

幸运传媒
SaaSykit:Laravel SaaS 入门套件徽标

SaaSykit:Laravel SaaS 入门套件

SaaSykit 是一个多租户 Laravel SaaS 入门套件,包含运行现代 SaaS 所需的所有功能,例如支付、美观的结账界面、管理面板、用户仪表盘、身份验证、现成组件、统计数据、博客、文档等等。

SaaSykit:Laravel SaaS 入门套件
MongoDB 徽标

MongoDB

Enhance your PHP applications with the powerful integration of MongoDB and Laravel, empowering developers to build applications with ease and efficiency. Support transactional, search, analytics and mobile use cases while using the familiar Eloquent APIs. Discover how MongoDB's flexible, modern database can transform your Laravel applications.

MongoDB
Spatie Shares Their Coding Guidelines as AI Skills image

Spatie Shares Their Coding Guidelines as AI Skills

阅读文章
AI Generative Engine Optimization for Laravel image

AI Generative Engine Optimization for Laravel

阅读文章
Attach PDFs Directly to Mailables in laravel-pdf 2.6.0 image

Attach PDFs Directly to Mailables in laravel-pdf 2.6.0

阅读文章
Composer 2.9.6 Fixes Two Perforce Command Injection Vulnerabilities image

Composer 2.9.6 Fixes Two Perforce Command Injection Vulnerabilities

阅读文章
Ship AI with Laravel: Your AI Agent Has Amnesia. Let's Fix It. image

Ship AI with Laravel: Your AI Agent Has Amnesia. Let's Fix It.

阅读文章
Redis Cluster Support for Queues in Laravel 13.5.0 image

Redis Cluster Support for Queues in Laravel 13.5.0

阅读文章