Vulnerability · Published Oct 24, 2023 · Assigned by PSF
CVE-2023-5752Mercurial configuration injectable in repo revision when installing via pip
Medium 5.5
In plain English
A medium-severity command injection in pip from Pip maintainers. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.5% (higher than 43% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official 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 packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | python-pip | no fix listed | DEBIAN-CVE-2023-5752 |
| Debian:13 | python-pip | 23.3+dfsg-1 | DEBIAN-CVE-2023-5752 |
| Debian:14 | python-pip | 23.3+dfsg-1 | DEBIAN-CVE-2023-5752 |
| PyPI | pip | 23.3 | PYSEC-2023-228 |
| PyPI | pip | 23.3 | GHSA-mq26-g339-26xf |
| Ubuntu:22.04:LTS | python-pip | no fix listed | UBUNTU-CVE-2023-5752 |
| Ubuntu:24.04:LTS | python-pip | no fix listed | UBUNTU-CVE-2023-5752 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| Pip maintainers | pip | see references |
Weakness: CWE-77 · Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N
References
- https://github.com/pypa/pip/pull/12306 patch
- https://mail.python.org/archives/list/security-announce@python.org/thread/F4PL35U6X4VVHZ5ILJU3PWUWN7H7LZXL/ vendor-advisory
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/YBSB3SUPQ3VIFYUMHPO3MEQI4BJAXKCZ/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/KFC2SPFG5FLCZBYY2K3T5MFW2D22NG6E/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/622OZXWG72ISQPLM5Y57YCVIMWHD4C3U/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/65UKKF5LBHEFDCUSPBHUN4IHYX7SRMHH/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/FXUVMJM25PUAZRQZBF54OFVKTY3MINPW/
- https://lists.debian.org/debian-lts-announce/2025/10/msg00028.html