CVE-2025-67746

4.3 MEDIUM

📋 TL;DR

This CVE describes a vulnerability in Composer PHP dependency manager where attackers controlling remote package sources could inject ANSI control characters into terminal output. This could cause mangled terminal displays, confusion for users, or potential denial-of-service of terminal applications. Users of Composer 2.x versions before 2.2.26 and 2.9.3 are affected.

💻 Affected Systems

Products:
  • Composer PHP Dependency Manager
Versions: Composer 2.x versions before 2.2.26 and 2.9.3
Operating Systems: All operating systems where Composer runs
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects users who download packages from untrusted or compromised remote sources.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Terminal applications could crash or become unusable due to malformed ANSI sequences, causing disruption to development workflows and potentially interrupting automated build processes.

🟠

Likely Case

Confusing or garbled terminal output that requires users to restart their terminal session, causing minor productivity disruption.

🟢

If Mitigated

With proper controls like using patched versions or trusted sources only, impact is minimal to none.

🌐 Internet-Facing: LOW - Requires attackers to control remote package sources that users download from, which is not typical for most deployments.
🏢 Internal Only: LOW - Primarily affects developer workstations and build environments rather than production systems.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: NO
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires attackers to control or compromise remote package repositories that users download from. No proven exploits exist according to the advisory.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 2.2.26 or 2.9.3

Vendor Advisory: https://github.com/composer/composer/security/advisories/GHSA-59pp-r3rg-353g

Restart Required: No

Instructions:

1. Check current Composer version: composer --version
2. Update Composer: composer self-update --stable
3. Verify update: composer --version should show 2.2.26+ or 2.9.3+
4. For global installations, use: composer self-update --rollback if needed

🔧 Temporary Workarounds

Use only trusted package sources

all

Configure Composer to only download packages from trusted, verified repositories

composer config --global secure-http true
composer config --global disable-tls false

Disable ANSI output

all

Run Composer with ANSI output disabled to prevent control character injection

composer --no-ansi [command]

🧯 If You Can't Patch

  • Only download packages from trusted, verified repositories and avoid untrusted sources
  • Monitor Composer output for unusual characters or garbled displays and investigate sources if observed

🔍 How to Verify

Check if Vulnerable:

Run 'composer --version' and check if version is before 2.2.26 or 2.9.3

Check Version:

composer --version

Verify Fix Applied:

Run 'composer --version' and confirm version is 2.2.26 or higher, or 2.9.3 or higher

📡 Detection & Monitoring

Log Indicators:

  • Unusual terminal output with ANSI escape sequences from Composer commands
  • Terminal applications crashing or hanging during Composer operations

Network Indicators:

  • Composer downloading packages from unusual or untrusted repositories

SIEM Query:

process.name:"composer" AND (event.action:"download" OR event.action:"install") AND network.destination.domain NOT IN ["packagist.org", "repo.packagist.org"]

🔗 References

📤 Share & Export