-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Fix anonymous unsigned trailing headers #21095
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
Merged
harshavardhana
merged 1 commit into
minio:master
from
klauspost:fix-anon-trailing-headers
Apr 1, 2025
Merged
Fix anonymous unsigned trailing headers #21095
harshavardhana
merged 1 commit into
minio:master
from
klauspost:fix-anon-trailing-headers
Apr 1, 2025
Conversation
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
Do not fail on anonymous requests with trailing headers. Fixes minio#21005 With modified minio-go (will send PR): ``` <DEBUG> PUT /tbb/mc.exe HTTP/1.1 Host: 127.0.0.1:9001 User-Agent: MinIO (windows; amd64) minio-go/v7.0.90 mc/DEVELOPMENT.GOGET Content-Length: 44301288 Accept-Encoding: zstd,gzip Content-Encoding: aws-chunked Content-Type: application/x-msdownload X-Amz-Content-Sha256: STREAMING-UNSIGNED-PAYLOAD-TRAILER X-Amz-Date: 20250401T150402Z X-Amz-Decoded-Content-Length: 44295168 X-Amz-Trailer: x-amz-checksum-crc32 mc: <DEBUG> HTTP/1.1 200 OK Content-Length: 0 Accept-Ranges: bytes Date: Tue, 01 Apr 2025 15:04:02 GMT Etag: "46273a30f232dc015ead1c0da8925c98" Server: MinIO Strict-Transport-Security: max-age=31536000; includeSubDomains Vary: Origin Vary: Accept-Encoding X-Amz-Checksum-Crc32: wElc/A== X-Amz-Id-2: 7987905dee74cdeb212432486a178e511309594cee7cb75f892cd53e35f09ea4 X-Amz-Request-Id: 18323A0F322B41C8 X-Content-Type-Options: nosniff X-Ratelimit-Limit: 2478 X-Ratelimit-Remaining: 2478 X-Xss-Protection: 1; mode=block ``` Tested on multipart uploads as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR addresses the issue of handling anonymous requests with trailing headers by adjusting the authorization logic in the streaming signature handling code. Key changes include:
- Splitting the case for authTypeStreamingUnsignedTrailer from the combined case.
- Adding a conditional to treat ErrMissingFields as a valid anonymous request.
- Refining the authorization flow based on request header contents.
Comments suppressed due to low confidence (2)
cmd/auth-handler.go:759
- Please ensure that unit tests specifically cover the authTypeStreamingUnsignedTrailer case, verifying that ErrMissingFields is interpreted correctly as an indication of an anonymous request.
case authTypeStreamingUnsignedTrailer:
cmd/auth-handler.go:761
- [nitpick] Consider expanding the inline comment to explicitly clarify that encountering ErrMissingFields signifies an anonymous request with zero-valued credentials, ensuring future maintainability.
if s3Err == ErrMissingFields {
klauspost
added a commit
to klauspost/minio-go
that referenced
this pull request
Apr 1, 2025
Trailing headers would be ignored on anonymous uploads. Send these as unsigned aws chunked uploads. Requires minio/minio#21095
This was referenced Apr 1, 2025
harshavardhana
approved these changes
Apr 1, 2025
harshavardhana
pushed a commit
to minio/minio-go
that referenced
this pull request
Apr 2, 2025
Trailing headers would be ignored on anonymous uploads. Send these as unsigned aws chunked uploads. Requires minio/minio#21095
harshavardhana
pushed a commit
that referenced
this pull request
May 30, 2025
Do not fail on anonymous requests with trailing headers. Fixes #21005 With modified minio-go (will send PR): ``` <DEBUG> PUT /tbb/mc.exe HTTP/1.1 Host: 127.0.0.1:9001 User-Agent: MinIO (windows; amd64) minio-go/v7.0.90 mc/DEVELOPMENT.GOGET Content-Length: 44301288 Accept-Encoding: zstd,gzip Content-Encoding: aws-chunked Content-Type: application/x-msdownload X-Amz-Content-Sha256: STREAMING-UNSIGNED-PAYLOAD-TRAILER X-Amz-Date: 20250401T150402Z X-Amz-Decoded-Content-Length: 44295168 X-Amz-Trailer: x-amz-checksum-crc32 mc: <DEBUG> HTTP/1.1 200 OK Content-Length: 0 Accept-Ranges: bytes Date: Tue, 01 Apr 2025 15:04:02 GMT Etag: "46273a30f232dc015ead1c0da8925c98" Server: MinIO Strict-Transport-Security: max-age=31536000; includeSubDomains Vary: Origin Vary: Accept-Encoding X-Amz-Checksum-Crc32: wElc/A== X-Amz-Id-2: 7987905dee74cdeb212432486a178e511309594cee7cb75f892cd53e35f09ea4 X-Amz-Request-Id: 18323A0F322B41C8 X-Content-Type-Options: nosniff X-Ratelimit-Limit: 2478 X-Ratelimit-Remaining: 2478 X-Xss-Protection: 1; mode=block ``` Tested on multipart uploads as well.
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.
Description
Accept anonymous requests with trailing headers.
Fixes #21005
With modified minio-go (will send PR):
Tested on multipart uploads as well - and of course checked that is still rejected on regular buckets.
How to test this PR?
Will send minio-go fix that will do this encoding.
Types of changes