Repository navigation
Use pylock generation command in empty-hash warnings - #21547
Open
astral-automations-bot[bot] wants to merge 1 commit into
Open
astral-automations-bot[bot] wants to merge 1 commit into
astral-automations-bot[bot] wants to merge 1 commit into
Conversation
astral-automations-bot
Bot
force-pushed
the
zb/pylock-empty-hash-command-hint
branch
from
September 16, 2026 11:46
095d8eb to
5db118c
Compare
Comment on lines
+562
to
+565
| if let Some(command) = generating_command(content) { | ||
| warn_user_once!( | ||
| "Empty hash tables in `pylock.toml` will be rejected in a future uv version. Run `{}` to regenerate the file.", | ||
| command.green() |
Contributor
Author
There was a problem hiding this comment.
[P3] Avoid trusting generation commands from remote pylock files
read_pylock_toml also passes HTTP(S) response bodies into PylockToml::parse, so content is not always a trusted local uv-generated file. This branch presents any matching header as uv's Run ... advice; generating_command rejects controls and backticks but still accepts shell syntax such as curl ... | sh. A malicious HTTP responder or remote lock publisher can therefore make uv recommend an attacker-chosen command, which executes with the user's authority if they follow the warning. Preserve source provenance and use generic guidance for remote locks instead of echoing their header as a command.
astral-automations-bot
Bot
force-pushed
the
zb/pylock-empty-hash-command-hint
branch
from
September 16, 2026 13:48
5db118c to
2b3daff
Compare
astral-automations-bot
Bot
force-pushed
the
zb/pylock-empty-hash-command-hint
branch
from
September 16, 2026 15:40
2b3daff to
4e11669
Compare
astral-automations-bot
Bot
force-pushed
the
zb/pylock-empty-hash-command-hint
branch
from
September 18, 2026 16:31
4e11669 to
0383ad2
Compare
astral-automations-bot
Bot
force-pushed
the
zb/pylock-empty-hash-command-hint
branch
from
October 7, 2026 18:18
0383ad2 to
5d96b62
Compare
This branch was previously deployed
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The empty-hash warning added in #21462 asks users to regenerate
pylock.tomlwithout showing the command recorded in uv-generated files. Read that command from the header and include it in the warning. Files without a usable header retain the general guidance, and hash tables with unsupported algorithms remain accepted without the empty-table warning.