Arbitrary Configuration Injection in Python Pip - CVE-2023-5752

python-pip Updated 02 Oct 2025

Summary

25/10/2023
N/A
No i
Medium
5.5

UBUNTU-CVE-2023-5752: 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 "-... Affects python-pip versions 1.4.1-2 – 1.5.4-1ubuntu4+esm5. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

Python Pip is a package management system used to install and manage software packages written in Python. It allows users to install packages from the Python Package Index (PyPI) and other repositories. The vulnerability in question affects various versions of Python Pip across multiple Ubuntu LTS releases, making it critical for users relying on this tool for package management.

Vulnerability Detail

The vulnerability arises when installing packages from a Mercurial VCS URL (e.g., 'pip install hg+...'). Prior to version 23.3, the specified Mercurial revision could be exploited to inject arbitrary configuration options into the 'hg clone' command, such as '--config'. This could lead to unauthorized modifications in how and which repository is installed, potentially compromising the integrity of the software being installed. Users who do not install from Mercurial are not affected by this issue.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary workaround, users can avoid installing packages from Mercurial VCS URLs until they have updated to a secure version of Python Pip. Additionally, consider using alternative package sources that do not rely on Mercurial.

Conclusion

CVE-2023-5752 presents a significant risk to users of Python Pip, particularly those who install packages from Mercurial VCS URLs. It is crucial to update to the latest version of Python Pip to mitigate this vulnerability and ensure the integrity of software installations.

See every vulnerability recorded for python-pip →

Share this vulnerability

FAQ

CVE-2023-5752 is a vulnerability in Python Pip that allows arbitrary configuration injection when installing packages from Mercurial VCS URLs.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

The risks include unauthorized modifications to the software being installed, which could lead to security breaches or the installation of malicious code.

Yes, users should update to Python Pip version 23.3 or later to patch this vulnerability.

If immediate updating is not possible, avoid installing packages from Mercurial VCS URLs as a temporary measure.

Related vulnerabilities

Recent vulnerabilities recorded for python-pip.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback