Arbitrary Configuration Injection in Python Pip via Mercurial URLs

python-pip Updated 02 Oct 2025

Summary

25/10/2023
N/A
Yes i
Unrated
Not published

DEBIAN-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 < 23.3+dfsg-1. Fixed in 23.3+dfsg-1. 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 Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Python Pip is a package management system for Python that allows users to install and manage software packages written in Python. It simplifies the process of package installation and dependency management. However, prior to version 23.3, Pip had a vulnerability that allowed users to inject arbitrary configuration options when installing packages from Mercurial version control system (VCS) URLs.

Vulnerability Detail

The vulnerability arises when a user installs a package from a Mercurial VCS URL using Pip prior to version 23.3. The specified Mercurial revision can be manipulated 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 allowing malicious actors to alter the installation process.

How To Fix

Minimum fixed version

23.3+dfsg-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade python-pip

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, users should avoid installing packages from Mercurial URLs until they have updated to the patched version of Pip.

Conclusion

The vulnerability in Python Pip allows for arbitrary configuration injection when installing packages from Mercurial URLs, posing a risk to users. It is crucial to update to version 23.3+dfsg-1 or later to mitigate this risk. Users should also consider using Vulert to monitor and alert for open-source vulnerabilities in their software.

See every vulnerability recorded for python-pip →

Share this vulnerability

FAQ

The vulnerability allows arbitrary configuration injection during package installation from Mercurial URLs, potentially compromising the installation process.

Versions of Python Pip prior to 23.3 are affected by this vulnerability.

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

If you cannot update Pip immediately, avoid installing packages from Mercurial URLs as a temporary workaround.

Related vulnerabilities

Recent vulnerabilities recorded for python-pip.

How To Fix

Minimum fixed version

23.3+dfsg-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade python-pip

Tip — Not sure which version your app runs? Vulert can match this fix to it. 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