Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2024-35241

CVE-2024-35241: Composer for PHP RCE Vulnerability

CVE-2024-35241 is a remote code execution flaw in Composer for PHP affecting versions prior to 2.2.24 and 2.7.7. Attackers can exploit crafted git branch names to execute code. This article covers technical details, patches, and workarounds.

Updated: January 22, 2026

CVE-2024-35241 Overview

CVE-2024-35241 is a command injection vulnerability affecting Composer, the widely-used dependency manager for PHP. On the 2.x branch prior to versions 2.2.24 and 2.7.7, the status, reinstall, and remove commands can be exploited when packages are installed from source via git containing specially crafted branch names in the repository. This allows attackers to execute arbitrary code on systems running vulnerable versions of Composer.

Critical Impact

Attackers can achieve arbitrary code execution by crafting malicious git branch names that are processed unsafely by Composer commands, potentially compromising development environments and CI/CD pipelines.

Affected Products

  • Composer 2.x versions prior to 2.2.24 (2.2 LTS branch)
  • Composer 2.x versions prior to 2.7.7 (mainline branch)
  • Systems using git-based package installation with Composer

Discovery Timeline

  • 2024-06-10 - CVE-2024-35241 published to NVD
  • 2025-04-21 - Last updated in NVD database

Technical Details for CVE-2024-35241

Vulnerability Analysis

This vulnerability is classified as CWE-77 (Command Injection), where user-controllable input is improperly sanitized before being passed to a system command. The attack requires user interaction, as a developer must execute specific Composer commands (status, reinstall, or remove) on packages that were installed from a malicious git repository.

The vulnerability poses significant risk to PHP development environments where dependencies are managed via git sources rather than packaged distributions. The impact extends to confidentiality, integrity, and availability, as successful exploitation allows complete control over the affected system within the context of the user running Composer.

Root Cause

The root cause of CVE-2024-35241 lies in insufficient input validation and sanitization of git branch names when Composer processes packages installed from source repositories. When a repository contains a specially crafted branch name with embedded command sequences, Composer fails to properly escape or validate this input before using it in shell operations.

This allows an attacker who controls a git repository (or can inject malicious branch names) to embed shell metacharacters or command sequences within branch names that get executed when the affected Composer commands process the repository metadata.

Attack Vector

The attack vector is network-based but requires user interaction. An attacker must:

  1. Create or compromise a git repository used as a Composer dependency
  2. Craft a malicious branch name containing command injection payloads
  3. Wait for a victim to install the dependency via git source (--prefer-source or default behavior)
  4. The victim must then execute one of the vulnerable commands: status, reinstall, or remove

The malicious branch name is not sanitized when these commands construct shell operations, allowing the embedded commands to execute with the privileges of the user running Composer. This could lead to data exfiltration, backdoor installation, or lateral movement within development infrastructure.

Detection Methods for CVE-2024-35241

Indicators of Compromise

  • Unexpected command execution or process spawning during Composer operations
  • Unusual network connections initiated from development environments during composer status, composer reinstall, or composer remove commands
  • Git repositories with branch names containing shell metacharacters such as ;, |, $(), or backticks
  • Anomalous file system changes following Composer command execution

Detection Strategies

  • Monitor for unusual child processes spawned by PHP or Composer processes
  • Implement file integrity monitoring on development systems and CI/CD runners
  • Audit git repository branch names in dependencies for suspicious characters or patterns
  • Review Composer logs and command history for unexpected behaviors

Monitoring Recommendations

  • Enable verbose logging for Composer operations in production and development environments
  • Configure endpoint detection to alert on shell command execution from PHP processes
  • Implement network monitoring for unexpected outbound connections from build servers
  • Regularly audit the list of git-sourced dependencies in composer.lock files

How to Mitigate CVE-2024-35241

Immediate Actions Required

  • Upgrade Composer to version 2.2.24 (for 2.2 LTS users) or 2.7.7 (for mainline users) immediately
  • Audit all projects for dependencies installed via git source and consider reinstalling from distribution packages
  • Review CI/CD pipeline configurations to ensure they use patched Composer versions
  • Scan existing composer.lock files for packages with git source installations

Patch Information

Security patches are available in Composer versions 2.2.24 and 2.7.7. The fixes address the improper handling of git branch names in the affected commands. Detailed patch information can be found in the GitHub Security Advisory and the associated commits:

  • Patch Commit for 2.7.x branch
  • Patch Commit for 2.2.x LTS branch

Linux distribution users should also check for updates through their package managers. Fedora has released package announcements addressing this vulnerability.

Workarounds

  • Use the --prefer-dist flag when installing packages to avoid git-based installations
  • Configure preferred-install: dist in your composer.json or global Composer configuration
  • Avoid using the status, reinstall, or remove commands on packages from untrusted git sources until patched
  • Consider implementing repository allowlists to restrict git-based installations to trusted sources only
bash
# Configuration example to prefer distribution packages
# Add to composer.json or ~/.composer/config.json
composer config preferred-install dist

# Or specify globally
composer config --global preferred-install dist

# When installing dependencies, explicitly use distribution packages
composer install --prefer-dist
composer update --prefer-dist

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechComposer

  • SeverityHIGH

  • CVSS Score8.8

  • EPSS Probability0.47%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityHigh
  • AvailabilityHigh
  • CWE References
  • CWE-77
  • Technical References
  • GitHub Commit Update

  • GitHub Commit Update

  • GitHub Security Advisory

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Vicarius CVE Detection Guide

  • Vicarius CVE Mitigation Guide
  • Related CVEs
  • CVE-2026-40261: Composer Command Injection RCE Vulnerability

  • CVE-2026-40176: Composer Command Injection RCE Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English