Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 918431 (CVE-2023-45805) - <dev-python/unearth-0.11.2 <dev-python/pdm-2.10.0: dependency confusion
Summary: <dev-python/unearth-0.11.2 <dev-python/pdm-2.10.0: dependency confusion
Status: RESOLVED FIXED
Alias: CVE-2023-45805
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All Linux
: Normal trivial (vote)
Assignee: Gentoo Security
URL: https://github.com/pdm-project/pdm/se...
Whiteboard: ~2 [noglsa]
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-24 21:03 UTC by John Helmert III
Modified: 2023-11-25 06:47 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2023-11-24 21:03:40 UTC
CVE-2023-45805:

pdm is a Python package and dependency manager supporting the latest PEP standards. It's possible to craft a malicious `pdm.lock` file that could allow e.g. an insider or a malicious open source project to appear to depend on a trusted PyPI project, but actually install another project. A project `foo` can be targeted by creating the project `foo-2` and uploading the file `foo-2-2.tar.gz` to pypi.org. PyPI will see this as project `foo-2` version `2`, while PDM will see this as project `foo` version `2-2`. The version must only be `parseable as a version` and the filename must be a prefix of the project name, but it's not verified to match the version being installed. Version `2-2` is also not a valid normalized version per PEP 440. Matching the project name exactly (not just prefix) would fix the issue. When installing dependencies with PDM, what's actually installed could differ from what's listed in `pyproject.toml` (including arbitrary code execution on install). It could also be used for downgrade attacks by only changing the version. This issue has been addressed in commit `6853e2642df` which is included in release version `2.9.4`. Users are advised to upgrade. There are no known workarounds for this vulnerability.

This is a bit confusing, the advisory at URL is for dev-python/unearth
but it's in the pdm repository, while there's a referenced pdm commit
that says it comes from the unearth advisory:

https://github.com/pdm-project/pdm/commit/6853e2642dfa281d4a9958fbc6c95b7e32d84831

All in all, seems like the fixes are in unearth-0.11.2, pdm-2.10.0
(which is *not* what the CVE says). So, please cleanup remaining
vulnerable unearth versions.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2023-11-25 06:17:40 UTC
cleanup done.
Comment 2 John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2023-11-25 06:47:23 UTC
Thanks! All done.