Repository navigation
Description
Problem
A zero-byte SSE-C object never has its customer key authenticated. GetObjectNInfo returns early for zero-byte objects without constructing a decryptor (cmd/erasure-object.go:262), and ObjectInfo.decryptChecksum returns immediately when the object carries no checksum (cmd/encryption-v1.go). Nothing on the path unseals the stored object key, so a syntactically valid but incorrect key is accepted.
Observed behaviour
Reproduced on main (ce456dba0), identical on ErasureSD and Erasure:
| Request | Expected | Actual |
|---|---|---|
| GET a zero-byte SSE-C object with a wrong key | 403 | 200 |
| CopyObject a zero-byte SSE-C object to a new key with a wrong source key | 403 | 200 |
| Either request against a non-empty object | 403 | 403 |
The zero-byte early return dates to upstream commit 523bd76 (2024-05-05) and is present in RELEASE.2026-08-06T00-00-00Z. This is inherited from upstream, not introduced by SILO.
Impact
Low. A zero-byte object has no plaintext to disclose, so neither request yields data the caller did not already have. What remains is:
- AWS S3 compatibility: an incorrect SSE-C key must return
403 AccessDenied. - A caller holding
s3:GetObject/s3:PutObjectbut not the object key can produce a copy of the object sealed under a key of their choosing.
Only GET and CopyObject were exercised. Any other path that reads an object should be checked against the same early return.
Reproduction
Write a zero-byte SSE-C object with no checksum, then read it back with a different, internally MD5-consistent key:
putCopyChecksumSource(t, apiRouter, credentials, bucketName, object, nil, map[string]string{
xhttp.AmzServerSideEncryptionCustomerAlgorithm: xhttp.AmzEncryptionAES,
xhttp.AmzServerSideEncryptionCustomerKey: base64.StdEncoding.EncodeToString(oldKey),
xhttp.AmzServerSideEncryptionCustomerKeyMD5: base64.StdEncoding.EncodeToString(oldMD5[:]),
})
// GET with wrongKey returns 200 instead of 403The same object copied to another key with x-amz-copy-source-server-side-encryption-customer-key set to the wrong key also returns 200.
Proposed direction
Authenticate the key where the data path stops being able to do it, rather than at each call site: before the zero-byte early return, unseal the stored object key with the supplied SSE-C key and fail with crypto.ErrInvalidCustomerKey when it does not match. That covers every reader uniformly instead of leaving each handler to remember.
Acceptance criteria
- GET, HEAD and CopyObject of a zero-byte SSE-C object with an incorrect key return
403 AccessDenied. - The same requests with the correct key are unaffected, including objects with and without checksums.
- Non-empty objects keep their current behaviour.
- No on-disk format change.
Relationship to other work
- The CopyObject SSE-C key-rotation path receives an explicit key check as part of Metadata-only CopyObject of a null version rewrites the data and leaves the metadata inconsistent #83, so that change stays authentication-neutral. That check is scoped to the rotation it diverts and does not close this issue: ordinary zero-byte rewrites such as SSE-C to SSE-S3/KMS, or a storage-class change, still inherit this gap.
Activity
Vonng commentedon Aug 29, 2026
Local implementation status and acceptance correction
The zero-byte
GetObjectNInfofix is implemented locally as DCO commitda7d6ed67oncodex/issue-82-zero-ssec; it is not pushed yet.One acceptance criterion in the issue body is broader than the defect:
HeadObjectalready authenticates SSE-C explicitly for every object size. The repaired paths are GET, CopyObject, and UploadPartCopy; HEAD remains a non-regression assertion.The implementation authenticates supplied SSE-C/SSE-Copy keys only after range and request preconditions, and bypasses absent-header internal reads,
NoDecryption, replication, and restore requests. Coverage includes zero/nonzero key parity, cross-object and storage-class copies, UploadPartCopy part non-creation, conditional/range ordering, and internal reader shapes on both object-layer backends. Focused normal/race,go vet ./cmd, and a clean fullgo test -tags kqueue,dev ./cmdpass.A separate, broader
GetObjectAttributeskey-authentication defect is tracked in #84.Vonng commentedon Aug 29, 2026
PR submitted
The release candidate is PR #87, stacked after #83 so the zero-byte rotation error-contract adjustment is reviewed explicitly. The final stacked hashes are
b73581b05plus integration testc4fd97d0b.Hosted CI is now the active gate. No tag or release was created.
Vonng commentedon Aug 29, 2026
Resolved by #87. Zero-byte SSE-C reads now authenticate the customer key at the object layer while preserving NoDecryption, replication, restore, range, precondition, and internal-read contracts. Final main 1be684b passed Go CI, VulnCheck, the full local race suite, and Test Release run 33254848256.