Decrypting non-encrypted content with AmazonS3EncryptionClientV2 #63
Answered
by
ashishdhingra
simenstensas
asked this question in
Q&A
-
Hi! I've upgraded to the latest preview of AmazonS3EncryptionClientV2 and so far it works out of the box with encrypted content. However it fails when getting non-encrypted content with message "Amazon.Runtime.AmazonServiceException: Unable to decrypt data for object [object] in bucket [bucket]". Since the metadata contains information about whether the content is encrypted or not, could one just not decrypt it if no headers are found? If this is not possible, what could be a solution for me? |
Beta Was this translation helpful? Give feedback.
Answered by
ashishdhingra
Dec 11, 2024
Replies: 1 comment 4 replies
-
@bhoradc Is this something you know? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@simenstensas We had contacted Crypto Tools team (which owns Java S3 Encryption client) and got the below response:
The behavior to return plaintext violates the security guarantees of the library. A threat actor with write access to S3 can replace an encrypted object with a plaintext object, and the
GetObject
operation succeeds. This violates the integrity guarantee, i.e. that the original plaintext has not replaced with a different plaintext. Therefore, plaintext objects must be handled outside of the security boundary of the S3EC.The current behavior makes sense. We would work on improving the error messaging to return exception with message like
Please ensure the object you are att…