Skip to content

fix(signer): sign every value of repeated query parameters - #5878

Merged
dreamorosi merged 1 commit into
aws-powertools:mainfrom
turmspringer:fix/signer-repeated-query-params
Oct 30, 2026
Merged

dreamorosi merged 1 commit into
aws-powertools:mainfrom
turmspringer:fix/signer-repeated-query-params

Conversation

@turmspringer

Copy link
Copy Markdown
Contributor

Summary

SigV4Signer kept only the last value of a repeated query parameter when building the canonical request, so ?tag=red&tag=blue was signed as ?tag=blue while the request still carried both values. API Gateway then rejected the request with a signature mismatch. The signer now passes all values to @smithy/signature-v4.

Changes

  • Collect every value of a query parameter in SigV4Signer: a single value stays a string, a repeated parameter becomes a string[]
  • Add a unit test that signs ?tag=red&foo=bar&tag=blue and compares the authorization header with SignatureV4 signing query: { foo: 'bar', tag: ['red', 'blue'] } directly

Issue number: closes #5870


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

🤖 Generated with Claude Code

@dreamorosi dreamorosi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for filing the issue and for the PR!

@dreamorosi
dreamorosi merged commit bf34c7a into aws-powertools:main Oct 30, 2026
43 checks passed
@powertools-for-aws-oss-automation

Copy link
Copy Markdown

Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience!

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

Labels

size/M PR between 30-99 LOC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: SigV4Signer signs only the last value of a repeated query parameter

2 participants