PYSEC-2023-228: Mercurial configuration injectable in repo revision when installing via pip

Published Oct 24, 2023
·
Updated

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 Software

1 affected component
pypi/pip<23.3

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in v23.3

Event History

Oct 24, 2023
CVE Published
via OSV·08:56 PM
Data Sourced
via OSV·08:56 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Who is exposed to this issue?

Users of pip versions before 23.3 are affected only when installing a package from a Mercurial VCS URL, such as an hg+ URL. Users who do not install from Mercurial are not affected.

2

What access does an attacker need to exploit it?

The attacker needs the ability to influence the Mercurial revision specified for a pip installation. That revision can inject Mercurial configuration options into the hg clone invocation, potentially changing how and which repository is installed.

3

What should be done if the affected installation method is required?

Upgrade pip to version 23.3 or later. Until upgrading is possible, avoid installing packages from Mercurial VCS URLs and do not use untrusted or attacker-influenced Mercurial revision values.

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