Skip to content

s3manager: Signature errors when proxies don't respect Range headers #2722

Closed as not planned
@gdavison

Description

Acknowledgements

Describe the bug

When used from behind a caching proxy, if the proxy is not configured to pass requests with a Range header unchanged, the AWS API returns signature errors. This appears to be because the Range header is included in the signed headers.

Expected Behavior

The expected behaviour is that the requests would succeed, either with parallel requests or with a fallback to requesting the full object.

Current Behavior

The requests fails with a SignatureDoesNotMatch error.

The request contains the header values:

  • Authorization: AWS4-HMAC-SHA256 Credential=ASIA************VBYM/20231019/eu-west-1/s3/aws4_request, SignedHeaders=accept-encoding;amz-sdk-invocation-id;amz-sdk-request;host;range;x-amz-content-sha256;x-amz-date;x-amz-security-token, Signature=*****
  • Range: bytes=0-5242879

In the error response, the <CanonicalRequest>, however shows an empty range:, suggesting that the user's proxy remove the Range header.

Reproduction Steps

Use the S3 Download manager from behind a proxy, e.g. nginx, which strips the Range header from a request.

Possible Solution

Possible solutions are:

  • Not include the Range header in the request signature
  • Retrying a full GetObject request if the Ranged request fails with a signature error

Additional Information/Context

These are the errors reported to us:

AWS Go SDK V2 Module Versions Used

github.com/aws/aws-sdk-go-v2 v1.30.3
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.8
github.com/aws/aws-sdk-go-v2/service/s3 v1.58.2

Compiler and Version used

go version go1.22.5 darwin/arm64

Operating System and version

macOS 13.6.7 (22G720)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    response-requestedWaiting on additional info and feedback. Will move to "closing-soon" in 7 days.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions