You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Federated CopyObject mishandles SSE-encrypted sources (wrong bytes/length, possible corruption) #158
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.
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
fix: forward plaintext on federated CopyObject of SSE objects (#158)
Merge pull request #163 from pgsty/fix/issue-158-federated-copy-sse