Repository navigation
fix(registry): redact the upload Location in rejection errors - #24094
Merged
stonezdj merged 1 commit intoNov 9, 2026
Merged
Conversation
Codecov Reportβ
All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release-2.15.0 #24094 +/- ##
=================================================
Coverage ? 66.54%
=================================================
Files ? 1076
Lines ? 117383
Branches ? 2962
=================================================
Hits ? 78116
Misses ? 34957
Partials ? 4310
Flags with carried forward coverage won't be shown. Click here to find out more.
π New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
π‘ Changes recommended
Malformed Locations can still leak their full signed URL through url.Parse errors.
1 open finding
What changed in this PR
Redacts secrets from rejected registry upload Locations before errors reach replication logs.
Changes:
- Adds URL redaction for userinfo, query, and fragment.
- Adds regression tests for rejected Locations.
| File | Description |
|---|---|
src/βpkg/βregistry/βclient.go |
Redacts rejected upload URLs in errors. |
src/βpkg/βregistry/βclient_chunk_location_test.go |
Tests secret redaction. |
π§ Review effort: Balanced
π‘ Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+823
to
+825
| // redactUploadLocation renders a Location for error messages without userinfo, query or fragment, | ||
| // since registries may put credentials or signed upload tokens there and callers log these errors. | ||
| func redactUploadLocation(u *url.URL) string { |
stonezdj
approved these changes
Nov 5, 2026
Contributor
|
@bupd can you help to fix the CI failures? |
A rejected chunked-upload Location was quoted verbatim in the error, which replication logs. Registries can carry credentials or signed upload tokens in its userinfo or query, so render it without userinfo, query and fragment. Follow-up to GHSA-wjpm-hv5w-gxr6. Signed-off-by: Prasanth Baskar <prasanth@8gears.com> (cherry picked from commit 0c14c60) Signed-off-by: stonezdj <stonezdj@gmail.com>
stonezdj
force-pushed
the
backport/redact-upload-location-215
branch
from
November 9, 2026 02:24
f9a5d0a to
c88c746
Compare
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.

A rejected chunked-upload
Locationwas quoted verbatim in the error, which replication logs. This renders it without userinfo, query and fragment, so credentials or signed upload tokens do not reach the job log. Follow-up to GHSA-wjpm-hv5w-gxr6.Backport of #24068 to release-2.15.0. The commit cherry-picked cleanly with no changes.
Tests: go test of the touched packages (from src/).
Please indicate you've done the following: