fix: broken Content-MD5 header for S3 upload#527
Merged
Conversation
The MD5 hash was computed over an already-exhausted file reader, always producing a hash of empty content. Since Content-MD5 is optional for S3 presigned POST uploads and the signed policy already enforces integrity, remove it entirely.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #527 +/- ##
=======================================
Coverage 71.29% 71.30%
=======================================
Files 222 222
Lines 18682 18677 -5
=======================================
- Hits 13320 13318 -2
+ Misses 4185 4184 -1
+ Partials 1177 1175 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Member
Author
|
Thanks for the super quick review @zimeg! |
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.
Changelog
Summary
This pull request removes the MD5 hash computation and
Content-MD5header from S3 presigned POST uploads.[LOW] Use of Password Hash With Insufficient Computational Effortfor usingcrypto/md5ininternal/api/s3_upload.go.1B2M2Y8AsgTpgAmY7PhCfg==) because it was hashed over an already-exhaustedio.Reader.Content-MD5is optional for S3 presigned POST uploads since integrity is enforced by the signed policy.1B2M2Y8AsgTpgAmY7PhCfg==) 🤷🏻Preview
N/A
Testing
Requirements