Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong checksum calculation in handleUploadPart #576

Open
akshay-sawant-bh opened this issue Nov 21, 2023 · 1 comment
Open

Wrong checksum calculation in handleUploadPart #576

akshay-sawant-bh opened this issue Nov 21, 2023 · 1 comment

Comments

@akshay-sawant-bh
Copy link

if (contentMD5String != null) {
try {
contentMD5 = HashCode.fromBytes(
Base64.getDecoder().decode(contentMD5String));
} catch (IllegalArgumentException iae) {
throw new S3Exception(S3ErrorCode.INVALID_DIGEST, iae);
}
if (contentMD5.bits() != MD5.bits()) {
throw new S3Exception(S3ErrorCode.INVALID_DIGEST);
}
}

In handleUploadPart the code only checks for 128 bits and not the actual value, so even if someone sends a wrong MD5 base64 encoded string of file which is 128 bits the code will not throw an error.

@akshay-sawant-bh
Copy link
Author

akshay-sawant-bh commented Nov 21, 2023

This is for azureblob looks like we are not sending the actual content-MD5 received along with the Payload in case of azure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant