Skip to content

Redact pre-signed upload URLs in verbose output#19146

Merged
zsol merged 1 commit intomainfrom
zsol/jj-nnvmtpkulklr
Apr 24, 2026
Merged

Redact pre-signed upload URLs in verbose output#19146
zsol merged 1 commit intomainfrom
zsol/jj-nnvmtpkulklr

Conversation

@zsol
Copy link
Copy Markdown
Member

@zsol zsol commented Apr 24, 2026

This teaches DisplaySafeUrl about sensitive query parameters (that are typically used to sign S3 requests) to avoid leaking them in verbose logs.

Note: Errors might still contain these in two places:

  • reqwest errors contain a raw url
  • aws can return an error that itself contains the signature (this is probably fine to display unredacted, as it only happens when the signature is invalid anyway)

This PR is part of a stack containing 2 PRs:

  1. main
  2. "Redact pre-signed upload URLs" (this PR)
  3. Redact sensitive parts of URLs in reqwest errors #19147

Comment thread crates/uv-publish/src/lib.rs Outdated
Comment on lines +870 to +872
if let Some(url) = err.url_mut() {
DisplaySafeUrl::redact_sensitive_query_parameter_values(url);
}
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not super sure about this, should look into wrapping the error type instead

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've decided to punt on this for now - it seems safe, but I think a more robust approach would be better (like wrapping reqwest errors in a displaysafe type). Soon.

@zsol zsol force-pushed the zsol/jj-nnvmtpkulklr branch from fac4700 to 1c95afc Compare April 24, 2026 18:20
@zsol zsol changed the title Redact pre-signed upload URLs Redact pre-signed upload URLs in verbose output Apr 24, 2026
@zsol zsol marked this pull request as ready for review April 24, 2026 18:24
Comment thread crates/uv-redacted/src/lib.rs Outdated
const SENSITIVE_QUERY_PARAMETERS: &[&str] = &[
"X-Amz-Credential",
"X-Amz-Security-Token",
"X-Amz-Signature",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: are there other request signing schemes we'll want to support here eventually? If so we might (eventually) want to have a LazyLock<FxHashSet> or similar, but definitely not needed for now 🙂

@zsol zsol changed the title Redact pre-signed upload URLs in verbose output Redact pre-signed upload URLs Apr 24, 2026
@zsol zsol force-pushed the zsol/jj-nnvmtpkulklr branch from 1c95afc to 830a963 Compare April 24, 2026 20:19
@zsol zsol changed the title Redact pre-signed upload URLs Redact pre-signed upload URLs in verbose output Apr 24, 2026
@konstin konstin added security bug Something isn't working and removed security labels Apr 24, 2026
@zsol zsol merged commit 84a3244 into main Apr 24, 2026
55 checks passed
@zsol zsol deleted the zsol/jj-nnvmtpkulklr branch April 24, 2026 23:48
zanieb added a commit that referenced this pull request Apr 30, 2026
Small follow-up to #19146 which I
was looking into independently as a follow-up from the Codex security
patch at zaniebot#19

---------

Co-authored-by: zaniebot <zaniebot@accounts.zanie.blue>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants