fix: constrain anonymous shared-object downloads - #56
Merged
Merged
Conversation
Signed-off-by: Feng Ruohang <rh@vonng.com>
Signed-off-by: Feng Ruohang <rh@vonng.com>
This was referenced Sep 16, 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.
The anonymous share-download endpoint could proxy unauthenticated requests to non-object paths on the configured S3 server, including public metrics otherwise isolated behind the Console network boundary. Restrict it to object-content GETs at the configured origin and reject every redirect, while preserving normal public, presigned and versioned downloads and the original signed URL bytes.
No new configuration option is introduced. A full sharing-disable switch is a separate product capability; the existing link-format setting remains unchanged. Query-selected non-download operations, system paths and path traversal are rejected before any backend request. Client cancellation now cancels the upstream request.
Regression tests cover URL encodings, fake signatures on metrics paths, endpoint identity, subresources, same-origin and cross-origin redirects, cancellation, and existing share-link generation. A required CI job runs real API and browser sharing tests in both standalone and embedded SILO using the exact Console checkout. Product guidance links to the companion site; the changelog credits Jiri Pejchal (@jiri-pejchal) for the report.
Validation:
go test ./api ./pkg/... -count=1, the focused share-boundary race tests,golangci-lint, frontend type checking, and formatting all passed. Freshly built binaries also passed real API and Chromium sharing tests in both standalone and embedded SILO on 2026-09-16. This PR does not publish a Console release or update Server's formal Console dependency.Fixes #52.