Loading...
Skip to main content

CVE-2024-35242 — Vulnerability in composer/composer — CVE Details

HIGH

Composer has multiple command injections via malicious git/hg branch names

Published June 10, 2024Updated September 10, 2026Source: osv

Summary

### Impact The `composer install` command running inside a git/hg repository which has specially crafted branch names can lead to command injection. So this requires cloning untrusted repositories. ### Patches 2.2.24 for 2.2 LTS or 2.7.7 for mainline ### Workarounds Avoid cloning potentially compromised repositories.

Advisory Timeline

  • First published June 10, 2024 (854 days ago).
  • Last revised September 10, 2026 — 821 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Composer
Update composer/composer to 2.2.24 or later
composer require "composer/composer:^2.2.24"
Composer
Update composer/composer to 2.7.7 or later
composer require "composer/composer:^2.7.7"

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (2)

Affects 1 ecosystem: packagist (1).

PackageEcosystemAffectedFixed In
composer/composer
packagist
2.0.0, 2.0.0-RC1, 2.0.0-RC2, 2.0.0-alpha1 (+56 more)2.2.24
composer/composer
packagist
2.3.0, 2.3.0-RC1, 2.3.0-RC2, 2.3.1 (+38 more)2.7.7

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 8.8 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Frequently Asked Questions

What is CVE-2024-35242?
Composer has multiple command injections via malicious git/hg branch names This vulnerability has been assigned a severity rating of HIGH (CVSS score: 8.8/10).
How do I check if my project is affected by CVE-2024-35242?
CVE-2024-35242 affects composer/composer. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2024-35242 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
8.8

High exploitability or significant impact. Prioritize remediation within days.

Also Known As

GHSA-v9qv-c7wm-wgmf
BIT-composer-2024-35242

Related CVEs

  • CVE-2024-35241
    HIGH

    Composer has a command injection via malicious git branch name

  • CVE-2026-40261
    HIGH

    Composer has a command injection via malicious perforce reference

  • CVE-2026-65954
    HIGH

    PHPCSUtils: Remote code execution via eval() in AbstractArrayDeclarationSniff::getActualArrayKey()

  • CVE-2026-84361
    HIGH

    Composer arbitrary command execution via a malicious package's Perforce source URL

  • CVE-2026-61825
    HIGH

    code16/sharp has a stored XSS via data-html-content Sanitizer Bypass

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies