# CVE-2023-5752: Mercurial configuration injectable in repo revision when installing via pip

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: High; Availability impact: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.48% (percentile 34, 2026-11-26)
- **CWE:** CWE-77
- **Aliases:** GHSA-mq26-g339-26xf, PYSEC-2023-228
- **Published:** 2023-10-24T20:56:05.469Z
- **Modified:** 2026-09-10T03:50:03.949Z

## Who should check

- Projects that depend on PyPI package pip (\< 23.3)
- Anyone running Pip maintainers pip all versions

## Description

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.

## Affected and fixed versions

- PyPI `pip`: affected \< 23.3; fixed 23.3 (osv)
- Pip maintainers pip: all versions (cvelist)

## Mitigation

- Upgrade pip to 23.3 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2023-5752. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2023-5752.md
Affected: pip < 23.3
Fixed in: 23.3

Steps:
1. Search this machine and project for pip (PyPI), Pip maintainers pip: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2023-5752 being exploited?

There is no confirmed exploitation: CVE-2023-5752 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.48% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2023-5752?

Medium: CVSS 5.5 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2023-5752?

pip \< 23.3.

### Is there a fix for CVE-2023-5752?

Yes. Fixed in 23.3. Upgrade pip to 23.3 or later.

### How do I check if I'm affected by CVE-2023-5752?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://mail.python.org/archives/list/security-announce@python.org/thread/F4PL35U6X4VVHZ5ILJU3PWUWN7H7LZXL/>
- vendor: <https://nvd.nist.gov/vuln/detail/CVE-2023-5752>
- vendor: <https://github.com/advisories/GHSA-mq26-g339-26xf>
- patch: <https://github.com/pypa/pip/pull/12306>
- patch: <https://github.com/pypa/pip/commit/389cb799d0da9a840749fcd14878928467ed49b4>
- other: <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/YBSB3SUPQ3VIFYUMHPO3MEQI4BJAXKCZ/>
- other: <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KFC2SPFG5FLCZBYY2K3T5MFW2D22NG6E/>
- other: <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/622OZXWG72ISQPLM5Y57YCVIMWHD4C3U/>
- other: <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/65UKKF5LBHEFDCUSPBHUN4IHYX7SRMHH/>
- other: <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/FXUVMJM25PUAZRQZBF54OFVKTY3MINPW/>
- other: <https://lists.debian.org/debian-lts-announce/2025/10/msg00028.html>
- other: <https://github.com/pypa/advisory-database/tree/main/vulns/pip/PYSEC-2023-228.yaml>
- other: <https://github.com/pypa/pip>
- other: <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/622OZXWG72ISQPLM5Y57YCVIMWHD4C3U>
- other: <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/65UKKF5LBHEFDCUSPBHUN4IHYX7SRMHH>
- other: <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/FXUVMJM25PUAZRQZBF54OFVKTY3MINPW>
- other: <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KFC2SPFG5FLCZBYY2K3T5MFW2D22NG6E>
- other: <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/YBSB3SUPQ3VIFYUMHPO3MEQI4BJAXKCZ>
- other: <https://mail.python.org/archives/list/security-announce@python.org/thread/F4PL35U6X4VVHZ5ILJU3PWUWN7H7LZXL>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2023-5752>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-mq26-g339-26xf> (license: <https://creativecommons.org/licenses/by/4.0/>)
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/PYSEC-2023-228> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2023-5752> · JSON: <https://flawdb.com/api/v1/entries/CVE-2023-5752>
