The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
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
    • 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-2022-24828

CVE-2022-24828: Composer Dependency Manager RCE Vulnerability

CVE-2022-24828 is a remote code execution vulnerability in Composer, a PHP dependency manager, affecting integrators using VcsDriver::getFileContent. This article covers technical details, affected systems, and mitigation steps.

Published: February 11, 2026

CVE-2022-24828 Overview

CVE-2022-24828 is a command injection vulnerability in Composer, a widely-used dependency manager for the PHP programming language. The vulnerability exists in the VcsDriver::getFileContent method, where integrators using Composer code can experience code injection if user-controlled input is passed to the $file or $identifier arguments. This vulnerability was demonstrated on packagist.org where the composer.json's readme field could be used as a vector for injecting parameters into hg/Mercurial via the $file argument, or into git via the $identifier argument when arbitrary data is permitted.

Critical Impact

Attackers could inject malicious parameters into git and Mercurial commands executed by Composer, potentially leading to arbitrary command execution on systems running vulnerable versions.

Affected Products

  • Getcomposer Composer (multiple versions)
  • Tenable Tenable.sc
  • Fedora 34, 35, and 36

Discovery Timeline

  • 2022-04-13 - CVE-2022-24828 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2022-24828

Vulnerability Analysis

This vulnerability is classified under CWE-20 (Improper Input Validation) and CWE-88 (Improper Neutralization of Argument Delimiters in a Command). The core issue stems from insufficient validation of user-supplied input passed to the getFileContent method in both the GitDriver and HgDriver classes.

When processing version control operations, Composer constructs shell commands using the $identifier and $file parameters. Without proper validation, an attacker could craft malicious input starting with a hyphen character (-), which would be interpreted as command-line arguments rather than data, allowing injection of arbitrary parameters into git or Mercurial commands.

The attack is network-based and requires user interaction, such as a developer installing a malicious package or an integrator processing untrusted repository data. The vulnerability affects confidentiality, integrity, and availability, as successful exploitation could lead to arbitrary command execution with the privileges of the Composer process.

Root Cause

The root cause is improper input validation in the VcsDriver::getFileContent method. The $identifier and $file parameters were passed to shell commands without checking whether they begin with a hyphen character. In Unix command-line conventions, arguments starting with - are interpreted as option flags, allowing attackers to inject additional command-line parameters that alter the behavior of git or Mercurial executables.

Attack Vector

The attack vector involves an attacker controlling input to the getFileContent method through repositories hosted on package registries. On packagist.org, the composer.json's readme field could be manipulated to inject parameters. The attacker would craft a malicious $identifier or $file value beginning with a hyphen, causing the underlying git or Mercurial command to interpret subsequent characters as command-line options rather than data arguments.

php
// Security patch in src/Composer/Repository/Vcs/GitDriver.php
// Source: https://github.com/composer/composer/commit/2c40c53637c5c7e43fff7c09d3d324d632734709
     */
    public function getFileContent($file, $identifier)
    {
+        if (isset($identifier[0]) && $identifier[0] === '-') {
+            throw new \RuntimeException('Invalid git identifier detected. Identifier must not start with a -, given: ' . $identifier);
+        }
+
        $resource = sprintf('%s:%s', ProcessExecutor::escape($identifier), ProcessExecutor::escape($file));
        $this->process->execute(sprintf('git show %s', $resource), $content, $this->repoDir);
php
// Security patch in src/Composer/Repository/Vcs/HgDriver.php
// Source: https://github.com/composer/composer/commit/2c40c53637c5c7e43fff7c09d3d324d632734709
     */
    public function getFileContent($file, $identifier)
    {
-        $resource = sprintf('hg cat -r %s %s', ProcessExecutor::escape($identifier), ProcessExecutor::escape($file));
+        if (isset($identifier[0]) && $identifier[0] === '-') {
+            throw new \RuntimeException('Invalid hg identifier detected. Identifier must not start with a -, given: ' . $identifier);
+        }
+
+        $resource = sprintf('hg cat -r %s -- %s', ProcessExecutor::escape($identifier), ProcessExecutor::escape($file));
        $this->process->execute($resource, $content, $this->repoDir);

        if (!trim($content)) {

Detection Methods for CVE-2022-24828

Indicators of Compromise

  • Unusual git or Mercurial command executions with unexpected command-line arguments
  • Error logs showing RuntimeException messages about invalid git/hg identifiers starting with -
  • Anomalous activity in Composer process logs related to VCS operations
  • Unexpected subprocess spawning from PHP/Composer processes

Detection Strategies

  • Monitor process execution for git and hg commands containing suspicious parameter patterns
  • Implement application-level logging for VcsDriver::getFileContent calls to detect exploitation attempts
  • Review Composer dependency installation logs for packages with malformed identifiers
  • Deploy runtime application self-protection (RASP) to detect command injection attempts

Monitoring Recommendations

  • Enable verbose logging for Composer operations in CI/CD pipelines
  • Monitor for unexpected shell command executions originating from PHP processes
  • Implement file integrity monitoring on Composer installation directories
  • Set up alerts for failed Composer operations with exception messages referencing invalid identifiers

How to Mitigate CVE-2022-24828

Immediate Actions Required

  • Update Composer to the latest patched version immediately
  • Audit any custom integrations using VcsDriver::getFileContent for proper input validation
  • Review recently installed packages for potential compromise
  • Implement network-level monitoring for suspicious VCS traffic from build systems

Patch Information

The vulnerability has been addressed in the official Composer repository. The security fix adds validation to reject identifiers starting with a hyphen character and uses the -- argument separator in Mercurial commands to prevent parameter injection. The patch is available in commit 2c40c53637c5c7e43fff7c09d3d324d632734709. Additionally, Tenable has released Tenable Security Advisory TNS-2022-09 addressing this vulnerability in Tenable.sc. Fedora users should apply updates through the standard package management system for Fedora 34, 35, and 36. For more details, see the GitHub Security Advisory.

Workarounds

  • Restrict network access to package registries from production systems
  • Implement strict input validation for any custom code calling VcsDriver::getFileContent
  • Use a private Packagist mirror with vetted packages only
  • Consider running Composer operations in isolated container environments
bash
# Update Composer to the latest patched version
composer self-update

# Verify Composer version after update
composer --version

# Clear Composer cache to remove potentially compromised data
composer clear-cache

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechGetcomposer

  • SeverityHIGH

  • CVSS Score8.8

  • EPSS Probability0.27%

  • 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-20

  • CWE-88
  • Technical References
  • GitHub Security Advisory

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement
  • Vendor Resources
  • GitHub Commit Update

  • Tenable Security Advisory
  • Related CVEs
  • CVE-2021-41116: Getcomposer Composer RCE Vulnerability

  • CVE-2021-29472: Composer Dependency Manager RCE Vulnerability

  • CVE-2024-24821: Composer Privilege Escalation Vulnerability
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