# CVE-2023-5752: Command Injection in pip when used with Mercurial

Source: https://junglewise.ai/threats/cve-2023-5752-command-injection-in-pip-when-used-with-mercurial  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2023-10-25  
License: CC BY 4.0 with a link back

CVE-2023-5752 · Severity: low · CVSS 3.1 · Published 2023-10-25

When installing a package from a Mercurial VCS URL  (ie "pip install 
hg+...") with pip prior to v23.3, the specified Mercurial revision could
 be used to inject arbitrary configuration options to the "hg clone" 
call (ie "--config"). Controlling the Mercurial configuration can modify
 how and which repository is installed. This vulnerability does not 
affect users who aren't installing from Mercurial.

Technologies: [pip (PyPI)](https://junglewise.ai/threats/technologies/pip). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2023-5752 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2023-5752 being exploited in the wild.

**How severe is CVE-2023-5752?** Low severity, with a CVSS score of 3.1, published 25 October 2023.

**Which products and versions are affected?** pip (PyPI) ECOSYSTEM:introduced=0,fixed=23.3.

**Is there a fix for CVE-2023-5752?** Yes. pip (PyPI): upgrade to 23.3 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**Am I affected by CVE-2023-5752?** Check whether you run pip (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- pip (PyPI): upgrade to 23.3 or later

  ```sh
  pip install "pip>=23.3"
  ```


## Affected products

- pip (PyPI) ECOSYSTEM:introduced=0,fixed=23.3

## Identifiers

- CVE-2023-5752
- GHSA-mq26-g339-26xf
- PYSEC-2023-228

## Related threats

- [PyPA pip path traversal via doubly-encoded package URLs](https://junglewise.ai/threats/cve-2026-13346-pypa-pip-path-traversal-via-doubly-encoded-package-urls)
- [PYSEC-2026-2876 - pip Vulnerable to Inclusion of Functionality from Untrusted Control Sphere](https://junglewise.ai/threats/cve-2026-6357-pip-vulnerable-to-inclusion-of-functionality-from-untrusted)
- [PYSEC-2026-1796 - pip Path Traversal vulnerability](https://junglewise.ai/threats/cve-2026-1703-pip-path-traversal-vulnerability)
- [PYSEC-2026-1795 - pip's fallback tar extraction doesn't check symbolic links point to extraction directory](https://junglewise.ai/threats/cve-2025-8869-pip-s-fallback-tar-extraction-doesn-t-check-symbolic-links-point)
- [Python pip path traversal via entry point scripts](https://junglewise.ai/threats/cve-2026-8643-python-pip-path-traversal-via-entry-point-scripts)
