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

Published Oct 24, 2023
·
Updated

Mercurial configuration injectable in repo revision when installing via pip

Other sources

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.

— NVD

When installing a package from a Mercurial VCS URL, e.g. 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 (e.g. --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.

— GitHub

Affected Software

7 affected componentsFixes available
pip/pip<23.3
23.3
pypa pip<23.3
Microsoft cbl2 python3 3.9.19-13
Microsoft azl3 python3 3.12.3-1
Microsoft azl3 python3 3.12.0-4
redhat/pip<23.3
23.3
IBM Netezza Software<=11.3.0.3-IF2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/pip to a version that resolves this vulnerability.

    Fixed in 23.3
  2. Upgrade

    Upgrade redhat/pip to a version that resolves this vulnerability.

    Fixed in 23.3
  3. Upgrade

    Upgrade pip to a version that resolves this vulnerability.

    Fixed in 23.3
  4. Compensating control

    If you cannot upgrade pip to v23.3 or later, avoid installing packages from Mercurial VCS URLs (e.g., 'pip install hg+...') because pip prior to v23.3 can use the specified Mercurial revision to inject arbitrary '--config' options into the 'hg clone' call.

Event History

Oct 24, 2023
CVE Published
via MITRE·08:56 PM
Data Sourced
via MITRE·08:56 PM
DescriptionSeverityWeakness
Oct 25, 2023
Data Sourced
06:17 PM
DescriptionSeverityWeakness
Advisory Published
06:32 PM
Nov 2, 2023
Advisory Published
09:04 PM
Nov 3, 2023
Data Sourced
02:55 PM
RemedyAffected Software
Updated
02:55 PM
SeverityWeakness
Nov 21, 2023
Data Sourced
via Red Hat·04:07 AM
DescriptionSeverityAffected Software
Apr 21, 2024
Data Sourced
via NVD·03:15 AM
RemedyDescriptionSeverityWeaknessAffected Software
Updated
via NVD·03:15 AM
Affected Software
Apr 22, 2024
Data Sourced
via GitHub·02:50 PM
DescriptionSeverityWeaknessAffected Software
May 3, 2024
Updated
via NVD·03:16 AM
Affected Software
Jun 10, 2024
Updated
via NVD·05:16 PM
Affected Software
Updated
via NVD·06:15 PM
Affected Software
Jun 25, 2024
Data Sourced
via IBM·12:00 AM
DescriptionSeverityAffected Software
Sep 11, 2024
Data Sourced
via Microsoft·07:00 AM
DescriptionSeverityWeakness
Data Sourced
via Microsoft·07:00 AM
Affected Software
Nov 21, 2024
Updated
via NVD·08:42 AM
RemedyAffected Software
Feb 13, 2025
Updated
via NVD·06:16 PM
DescriptionAffected Software
Apr 26, 2025
Event
via FIRST·12:00 AM
Nov 3, 2025
Updated
via MITRE·05:31 PM
Description
Updated
via NVD·06:15 PM
Affected Software
Apr 6, 2026
Updated
via IBM·12:00 AM
DescriptionAffected Software
Aug 20, 2026
Updated
via IBM·12:00 AM
Affected Software

Parent advisories

This vulnerability appears in the following advisories.

Frequently Asked Questions

1

What is CVE-2023-5752?

CVE-2023-5752 is a vulnerability in the pip package manager that allows an attacker to inject arbitrary configuration options during package installation.

2

How does CVE-2023-5752 impact users?

CVE-2023-5752 can be exploited by an attacker to modify the Mercurial configuration during package installation, potentially compromising the integrity and security of the system.

3

What is the severity of CVE-2023-5752?

The severity of CVE-2023-5752 is medium, with a severity value of 5.5.

4

How can I fix CVE-2023-5752?

To fix CVE-2023-5752, users should update their pip package manager to version 23.3 or higher.

5

Where can I find more information about CVE-2023-5752?

You can find more information about CVE-2023-5752 on the GitHub pull request, the Python security-announce mailing list, and the NIST National Vulnerability Database.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203