Files
floci/src/main/java
Niels Kootstra a11040e841 fix(s3): reject a malformed aws-chunked upload instead of storing its framing (#5082)
* fix(s3): reject a malformed aws-chunked upload instead of storing its framing

When an aws-chunked body could not be decoded, the decoder logged the
failure and returned the raw body, so PutObject and UploadPart stored
the chunk headers and signatures as the object's content. A body that
ended before its final zero-length chunk was silently truncated.

A request whose x-amz-content-sha256 declares a streaming payload is
always framed, so a body that does not decode, or that ends before its
final chunk, now fails with a 400 IncompleteBody and nothing is stored.
The SigV4a (ECDSA) streaming variants count as streaming payloads too.

A Content-Encoding naming aws-chunked without that declaration does not
guarantee framing, so a body that does not decode is still kept as
sent, rather than decoding to an empty object as before.

* fix(s3): require each chunk's line break and the closing line of a streaming upload

A streaming body whose chunk data was not followed by a line break, or
that ended right after its final chunk line or partway through its
trailer, was still accepted and stored. For a request that declares a
streaming payload, each chunk's data must now be followed by a line
break and the body must reach the empty line that ends it; otherwise
the upload fails with a 400 IncompleteBody.
2026-10-04 13:50:45 -04:00
..