Description
During RustFS validation for #3495, a video set to Only you was blocked by Cap's share page/API for an unauthenticated visitor, but its object remained readable through an unsigned S3 URL.
Cap's self-hosted startup code applies a bucket-wide anonymous s3:GetObject policy whenever CreateBucket succeeds. This allows anyone who knows an object's key or URL to read it directly, bypassing the video's visibility setting in Cap. The policy grants access to every object in the configured bucket, not just public videos.
Expected behavior: The default Cap bucket should remain private regardless of whether it is newly created or already exists. Public sharing should continue to work through Cap's access checks and signed object URLs.
Actual behavior: A successful CreateBucket response causes Cap to install a public-read policy, including when the backend returns success for an already-owned bucket.
Reproduction
The following sequence was observed with RustFS 1.0.3 during #3495 validation:
-
Configure a self-hosted Cap Web instance to use RustFS, with region
us-east-1, path-style URLs, and thecapbucket. -
Pre-create the bucket without anonymous read access, as the Compose bucket initializer does.
-
Start Cap Web and allow its S3 initialization to finish. Inspect the bucket policy: Cap has added an statement with , , and .