Skip to content

Federated CopyObject mishandles SSE-encrypted sources (wrong bytes/length, possible corruption) #158

Closed

Description

@Vonng

Summary

In a legacy etcd bucket-federation deployment, a cross-deployment whole-object CopyObject of an SSE-encrypted source (or to an SSE-encrypted destination) forwards the wrong bytes and/or the wrong length to the remote instance, causing the copy to fail or, worse, to silently store corrupted data.

This is a pre-existing defect in the federated branch of CopyObjectHandler, independent of the checksum/metadata work in #99/#100. The reader/length forwarded to core.PutObject(..., srcInfo.Reader, srcInfo.Size, ...) traces back to the upstream minio-go v7 migration (commit 778e9c864), long before those issues.

Evidence (adversarial analysis, single-part "abc", SSE-S3, ciphertext = 35 bytes)

cmd/object-api-utils.go decrypts the source reader but retains the stored ciphertext size in ObjInfo; destination encryption then wraps the stream; the forwarded PUT still declares srcInfo.Size:

Copy Forwarded reader / declared length Result
SSE → plain 3 plaintext bytes / 35 length mismatch; remote PUT fails
plain → SSE 35 locally-encrypted bytes / 3 length mismatch; remote PUT fails
SSE → SSE 35 locally-encrypted bytes / 35 length matches, corruption: the remote SSE-encrypts already-ciphertext bytes again; a destination GET returns the 35-byte inner ciphertext, and any checksum covers that ciphertext instead of "abc"

Suggested direction

Forward the logical (decrypted/decompressed) bytes with the actual logical size for federation, and let the destination PUT perform destination-side encryption once. Changing the declared length alone is insufficient.

Scope / priority

Legacy etcd bucket-federation is a deprecated path, so this is low-priority, but it is a genuine data-integrity bug for the SSE + federation combination and should be tracked. Federated copies of unencrypted objects are unaffected.

Found during the post-merge Codex review of #157 (federated CopyObject metadata + checksums).

Activity

  1. added
    bug
    on Sep 8, 2026
  2. moved this from Backlog to In progress in Siloon Sep 9, 2026
  3. added 2 commits that reference this issue on Sep 9, 2026
  4. moved this from In progress to Done in Siloon Sep 9, 2026
  5. self-assigned this
    on Sep 15, 2026
  6. added theissue type on Sep 15, 2026
  7. added this to the 20260916 milestone on Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

Projects

  • Status
    Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions