Repository navigation
Fail closed when a locked hash cannot be checked - #11030
Merged
Merged
Conversation
Two layers bind an installed artifact to the hashes in poetry.lock, and an index could skip both. The chooser accepted any link that advertised no hash at all, without comparing anything to the locked hashes, so 'no hash offered' was treated as 'accept' rather than 'compute and compare'. Removing that early accept lets the link fall through to the existing calculate_sha256 path, which is what the surrounding code already does for links advertising a different hash type. A link whose computed hash matches the lock is still chosen. The executor's post-download check only ran when the downloaded archive's filename appeared in the lock's files list, so an artifact served under an unlisted filename was never validated and its hash was never recorded. The filename condition is gone; if the lock pins hashes, the archive is checked. An archive the lock does not list now raises with that stated plainly, rather than falling through the empty-known-hashes case into the less specific 'no usable hash type' message. Both new tests fail without the corresponding change. Signed-off-by: Arpit Jain <[email protected]>
Try links best-first, and stop as soon as one has a verified hash matching the lock. Verifying a hash requires a full download when the index does not provide hashes, so this avoids downloading every candidate when the first (best) one already matches.
There was a problem hiding this comment.
Hey - I've reviewed your changes and they look great!
Sourcery assessment
Needs a human reviewer. If the verification logic is wrong, an attacker-controlled or otherwise unverified distribution could be selected and installed, potentially executing arbitrary package code across affected installations without an obvious failure signal. Reverting prevents future instances but cannot undo code already installed or executed.
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
mwalbeck
pushed a commit
to mwalbeck/docker-python-poetry
that referenced
this pull request
Sep 6, 2026
This PR contains the following updates: | Package | Update | Change | Pending | |---|---|---|---| | [poetry](https://github.com/python-poetry/poetry) ([changelog](https://python-poetry.org/history/)) | patch | `2.4.1` → `2.4.2` | `2.4.3` | --- ### Release Notes <details> <summary>python-poetry/poetry (poetry)</summary> ### [`v2.4.2`](https://github.com/python-poetry/poetry/blob/HEAD/CHANGELOG.md#242---2026-08-29) [Compare Source](python-poetry/poetry@2.4.1...2.4.2) ##### Fixed - Fix an issue where Poetry installs an artifact that is not listed in the lockfile when the package source does not provide a hash for this artifact ([#​11030](python-poetry/poetry#11030)). - Fix a path traversal vulnerability when downloading files from a compromised URL and/or package source ([#​11029](python-poetry/poetry#11029)). - Fix a path traversal vulnerability in sdist extraction on Python 3.10.0-3.10.12 and 3.11.0-3.11.4 that could allow malicious tarball files to write files outside the target directory ([#​11027](python-poetry/poetry#11027)). </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNjAuMCIsInVwZGF0ZWRJblZlciI6IjQzLjI2MC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Reviewed-on: https://git.walbeck.it/mwalbeck/docker-python-poetry/pulls/1760
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Check List