Repository navigation
fix: store raw SSE-C replicas verbatim on the destination - #122
Merged
Merged
Conversation
A raw SSE-C replica write carries the source ciphertext and the source seal in X-Minio-Replication-Server-Side-Encryption-* headers but no public SSE-C request headers, so crypto.Requested() was false and PutObjectHandler and NewMultipartUploadHandler applied the destination's default encryption and compression to bytes that were already ciphertext (upstream 468a9fa, "Enable replication of SSE-C objects", never exempted the raw path). With destination default SSE-S3 the replica's IV and seal were overwritten and GET returned 400; with destination compression the replica stored compress(ciphertext) and GET failed, while the source reported COMPLETED. Recognize a validated raw SSE-C replica (replicaTrusted plus a seal header, shared helper isRawSSECReplica) and skip bucket default encryption, compression and the encryption branch on the single PUT path, and default encryption plus compression on the multipart initiation path, which already skipped key generation. On the sender, reject replication of an object that is both compressed and SSE-C, since the wire carries no compression state and the destination would otherwise store an undetectable S2 stream, and make replicateObject/replicateAll report a putReplicationOpts failure as Failed instead of Completed. Tests: TestAPISSECReplicaSkipsDestinationTransforms (single PUT and multipart under destination default SSE-S3, compression and an explicit SSE header, plus an untrusted control), TestAPISSECMultipartReplicaRoundTripWith Compression, and TestPutReplicationOptsRejectsCompressedSSEC fail on main and pass with the fix on ErasureSD and Erasure; the replication-trust, multipart and PutObject suites stay green. Compatibility: no wire, API or metadata change; the destination change applies only to trusted replica writes carrying a source seal; replicas already transformed must be rewritten from an intact source (see #120 for why a resync does not do that yet). Fixes #109 Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01L7qJqWwy8oFA6aCXWRzXQe Signed-off-by: Feng Ruohang <[email protected]>
This was referenced Sep 5, 2026
Closed
…elper The raw SSE-C seal headers moved from an inline slice in cmd/object-multipart-handlers.go to the shared isRawSSECReplica helper in cmd/replication-trust.go (already recorded), so regenerate the compat-baseline allowlist to drop the three stale object-multipart entries. No behaviour change; make rebrand-guard is green. Refs #109 Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_01L7qJqWwy8oFA6aCXWRzXQe Signed-off-by: Feng Ruohang <[email protected]>
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.
Contribution Licensing (no CLA, inbound=outbound, DCO required)
This project does not use a CLA; contributions are accepted inbound=outbound.
By submitting this pull request I represent that I have the right to contribute
the changes, which are licensed under this repository's
GNU Affero General Public License v3.0 or later
and remain my copyright. Every commit carries a DCO
Signed-off-bytrailer.Description
A raw SSE-C replica write carries the source ciphertext and the source seal in the internal
X-Minio-Replication-Server-Side-Encryption-*headers but no public SSE-C request headers, so the destination treated it as a plain upload and applied its own bucket default encryption and compression to bytes that were already ciphertext. With destination default SSE-S3 the replica's IV and seal were overwritten and GET returned 400; with destination compression the replica storedcompress(ciphertext)and GET failed withXMinioObjectTampered, while the source reported the object asCOMPLETED.The destination now recognises a validated raw SSE-C replica (
replicaTrustedfrom the signature-verified trust evaluation plus a seal header; shared helperisRawSSECReplica) and stores it verbatim: single PUT skips bucket default encryption, compression and the encryption branch; multipart initiation skips default encryption and compression (it already skipped key generation). On the sender, an object that is both compressed and SSE-C is rejected byputReplicationOptsand reported asFailedinstead ofCompleted, because the wire carries no compression state and the destination would otherwise store an undetectable S2 stream (tracked as #118).Fixes #109. Fix plan agreed with the Codex reviewer: #109 (comment). Adversarial Codex review of this implementation: PASS in round 1 with one optional finding (compare the three seal fields with the source in the multipart-init cases instead of checking presence), which is applied.
Motivation and Context
Replication status
COMPLETEDmust mean a replica readable with the original customer key, on ordinary reads and on site failover. Upstream468a9fae8(Enable replication of SSE-C objects, minio#19107) added the raw-ciphertext path without exempting it from the destination's existing PUT transforms; the behaviour is inherited and present on upstream master. AWS documents that an SSE-C replica is retrieved with the same customer key the source used, so the destination cannot decrypt or re-frame the object.How to test this PR?
With the product hunks reverted, the
default-sse-s3,compression,explicit-sse-headerandmpu-compressionsubtests fail on ErasureSD and Erasure (mpu-default-sse-s3and the untrusted control pass on main, which pins the multipart split), and the other two tests fail; with the fix all pass, together with every test incmd/replication-trust_test.go, the replication tests incmd/handler-utils_test.go,TestObjectAPIPutObjectPart,TestAPIPutObjectHandler,TestAPINewMultipartHandlerandTestAPICompleteMultipartFullObjectVariants.go vetclean,gofmt -l cmdempty, golangci-lint 0 issues on./cmd/....Before release, the plan's bounded live check should be run once: two TLS sites, destination default SSE-S3 and destination compression, SSE-C objects of 0, 1 and 131072 bytes by single PUT and multipart, GET on the destination with the correct key byte-compared, wrong key refused. The 2026-09-05 review lab scripts cover the single-PUT legs.
Compatibility impact
No wire, API or metadata-format change: the same headers are sent and the same metadata keys are written; the destination change only removes transforms it should never have applied to trusted replica writes carrying a source seal, and ordinary client uploads (with or without real SSE-C headers) are untouched. Guarantees by endpoint: upgrading the destination protects it from transforms whatever the source runs; upgrading the source adds the compressed-SSE-C rejection whatever the destination runs; upgrading only the source does not protect an old destination. Replication failure accounting changes for compressed SSE-C sources (now
Failedwith an error instead ofCompleted). Replicas already transformed are not repaired by this change; a resync does not retransmit SSE-C data today (#120), so no recovery instruction is published until that is fixed and verified.Types of changes
Checklist:
git commit -s) per the DCO468a9fae8, not a SILO regression)make verifiersequivalent: gofmt clean, go vet clean, golangci-lint 0 issues on./cmd/...pgsty/silo.pgsty.com(release fix note; replication docs must not publish a recovery recipe until [P1] Existing SSE-C replicas cannot always be updated or repaired #120 lands)🤖 Generated with Claude Code
https://claude.ai/code/session_01L7qJqWwy8oFA6aCXWRzXQe