Skip to content

[UX] Bucket names aren't validated, PUT auto-creates buckets, and a bucket named "health" can't be listed #164

Closed

Description

@saworbit

Summary

check_bucket_name rejects only empty names, /, NUL and over-long names, and any object PUT silently creates its bucket. So a typo in a bucket name creates a new bucket, and since there's no ListBuckets or DeleteBucket (#159), you can't see it or remove it. Separately, the /health route shadows any bucket named health.

Classification

  • Type: UX Friction
  • Severity: Medium
  • Verification: Verified (Runtime)
  • Location: crates/protocol-s3/src/lib.rs:272-321 (auto-create in put_object), :539-549 (check_bucket_name), crates/protocol-s3/src/server.rs:48

Reproduction / Context

  1. PUT /UPPER, PUT /with%20space, PUT /%F0%9F%9A%80, PUT /a..b, PUT /-lead and PUT /x all return 200. S3 requires 3-63 characters of lowercase letters, digits, . and -, starting and ending with a letter or digit, and no ...
  2. PUT /health returns 405, because only GET is routed there. PUT /health/a.txt returns 200 and creates bucket health. After that, GET /health returns {"service":"SPACE S3 Protocol View","status":"healthy"}, so the bucket's listing can never be fetched.
  3. Real S3 answers a PUT into a missing bucket with 404 NoSuchBucket. SDK code written against S3 relies on that, so a typo here goes unnoticed.

Proposed Fix / Recommendation

  • Enforce S3 bucket naming rules in check_bucket_name and return InvalidBucketName. Existing stores may already hold invalid names, so keep reading those and refuse only new ones.
  • Return NoSuchBucket for an object PUT into a missing bucket. If auto-create is worth keeping for the curl demo, put it behind --auto-create-buckets and update the banner and the quick start.
  • Move the health check off the bucket namespace, either under a reserved prefix such as /-/health (bucket names can't start with -) or by reserving health as an invalid bucket name.

Activity

  1. added
    bug
    on Nov 13, 2026
  2. saworbit commented on Nov 13, 2026

    @saworbit
    OwnerAuthor

    Done in 39dfdb3 (#187). A PUT into a missing bucket now returns 404 NoSuchBucket, before the body is stored. New bucket names must follow S3's rules, or the request gets InvalidBucketName. Buckets an older build created keep working. The health check moved to /-/health, so a bucket named health can be listed. I kept no auto create flag: the quick start creates its bucket first. The changelog is updated. This closes when #187 merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugprotocol-s3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions