Reject invalid UTF-8 URL credentials - #54
Closed
zaniebot wants to merge 3 commits into
Closed
Conversation
zanieb
reviewed
Jun 11, 2026
zanieb
reviewed
Jun 11, 2026
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.
Summary
Why
Lossy decoding replaced malformed bytes with U+FFFD, silently changing the credential sent on the wire and collapsing distinct inputs. URL parsing remains permissive; the error is raised only when converting URL userinfo into uv's string credential model.
Follow-up to astral-sh#19800 (comment).
Validation
cargo test -p uv-auth --libcargo test -p uv --test pip_install install_package_basic_auth_invalid_utf8cargo check -p uv-auth -p uv-client -p uv-distribution-types -p uv-distribution -p uv-git -p uv-publish -p uvcargo +stable fmt --all -- --checkRepository-wide clippy under the local toolchain is currently blocked by warnings in unchanged files; no clippy suppressions or unrelated fixes are included here.