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-2023-5752

CVE-2023-5752: Pypa Pip RCE Vulnerability

CVE-2023-5752 is a remote code execution vulnerability in Pypa Pip that allows attackers to inject malicious configuration options during Mercurial VCS installations. This article covers technical details, affected versions, and mitigation.

Published: February 11, 2026

CVE-2023-5752 Overview

CVE-2023-5752 is a command injection vulnerability in pip, the Python package installer, that affects versions prior to v23.3. When installing a package from a Mercurial VCS URL (e.g., pip install hg+...), the specified Mercurial revision could be used to inject arbitrary configuration options to the hg clone call via the --config parameter. By controlling the Mercurial configuration, an attacker can modify how and which repository is installed, potentially leading to supply chain attacks or installation of malicious code.

Critical Impact

Attackers can inject arbitrary Mercurial configuration options during package installation, potentially redirecting repository sources or modifying installation behavior to introduce malicious code into development environments.

Affected Products

  • pypa pip (versions prior to v23.3)

Discovery Timeline

  • 2023-10-25 - CVE-2023-5752 published to NVD
  • 2025-11-03 - Last updated in NVD database

Technical Details for CVE-2023-5752

Vulnerability Analysis

This vulnerability is classified as CWE-77 (Command Injection), where user-controllable input is passed to a system command without proper sanitization. The flaw exists in pip's handling of Mercurial VCS URLs during package installation. When a user specifies a Mercurial repository URL with a revision parameter, pip constructs a command-line call to hg clone without adequately validating or escaping the revision string. This allows specially crafted revision parameters to break out of their intended context and inject additional --config options into the Mercurial command execution.

The vulnerability requires local access, as an attacker would need to convince a user to install a package from a malicious Mercurial URL or craft a requirements.txt file containing the malicious URL. While the impact is limited to integrity modifications (no direct confidentiality or availability impact), the potential for supply chain compromise makes this vulnerability noteworthy for development environments.

Root Cause

The root cause lies in insufficient input validation of the revision parameter in Mercurial VCS URLs. When pip processes URLs in the format hg+https://example.com/repo@revision, the revision portion is passed directly to the hg clone command without proper sanitization. This allows injection of Mercurial configuration options through crafted revision strings containing --config directives, enabling attackers to override default Mercurial behavior during the clone operation.

Attack Vector

The attack requires local access and low privileges to execute. An attacker can craft a malicious Mercurial VCS URL that includes injected configuration options in the revision field. When a victim executes pip install with this URL—either directly via command line or through a poisoned requirements.txt file—the injected configuration options are passed to the underlying hg clone command.

The malicious URL format would embed configuration options after the revision specifier. By injecting Mercurial configuration options, an attacker could potentially redirect the repository source, modify hook scripts that execute during clone operations, or alter other critical Mercurial behaviors. This represents a supply chain attack vector where developers could unknowingly install compromised packages.

Detection Methods for CVE-2023-5752

Indicators of Compromise

  • Presence of Mercurial VCS URLs in requirements.txt or pip install commands containing unusual characters or --config strings in the revision field
  • Unexpected hg clone command executions with non-standard configuration parameters in process logs
  • Package installations from Mercurial sources that result in different content than expected from the specified repository

Detection Strategies

  • Monitor pip installation logs for VCS URLs containing suspicious revision parameters with embedded command options
  • Implement static analysis of requirements.txt files in CI/CD pipelines to detect potentially malicious Mercurial URLs
  • Use SentinelOne Singularity to detect anomalous command-line arguments passed to hg processes during pip operations

Monitoring Recommendations

  • Enable verbose logging for pip operations in development and build environments to capture full command execution details
  • Implement network monitoring to detect connections to unexpected Mercurial repositories during package installation
  • Configure security tools to alert on pip processes spawning hg clone commands with --config arguments

How to Mitigate CVE-2023-5752

Immediate Actions Required

  • Upgrade pip to version 23.3 or later using pip install --upgrade pip
  • Audit existing requirements.txt files and pip install scripts for Mercurial VCS URLs
  • Avoid installing packages directly from Mercurial VCS URLs from untrusted sources until systems are patched

Patch Information

The vulnerability has been addressed in pip version 23.3 and later. The fix is documented in GitHub Pull Request #12306, which implements proper sanitization of revision parameters to prevent configuration injection. The Python Security Announcement provides official notification details. Distribution-specific patches are available through Fedora and Debian LTS security advisories.

Workarounds

  • If upgrading is not immediately possible, avoid using Mercurial VCS URLs for package installation entirely
  • Use only packages from PyPI or other trusted package indexes rather than VCS sources
  • Implement strict code review processes for any requirements.txt changes that introduce VCS URLs
bash
# Upgrade pip to the patched version
pip install --upgrade pip>=23.3

# Verify pip version after upgrade
pip --version

# Alternative: Use pipx for isolated pip upgrades
pipx upgrade pip

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

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechPip

  • SeverityLOW

  • CVSS Score3.3

  • EPSS Probability0.07%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-77
  • Technical References
  • Fedora Package Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Debian LTS Announcement
  • Vendor Resources
  • GitHub Pull Request #12306

  • Python Security Announcement
  • Related CVEs
  • CVE-2025-8869: pip Path Traversal 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