Skip to content

Signature V4 canonicalized query calculation wrong with numeric parameter values #3258

Description

@simonkey

Describe the bug

The calculation of the signature V4 canonicalized query is wrong for queries when a parameter key occurs multiple times and the parameter values are numeric. This results in a wrong signature.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

Correct calculation of the signature according to the standard.

Current Behavior

The signature is calculated wrong.

Reproduction Steps

Use a query which contains numeric parameter values.

E.g. sku=5033400&sku=10000010

Expected result: sku=10000010&sku=5033400

Current result: sku=5033400&sku=10000010

Possible Solution

Generally the SORT_STRING should be added to the corresponding sort function.
It can be found in SignatureV4::getCanonicalizedQuery in line 356.

The change from sort($v); to sort($v, SORT_STRING); resolves the issue.

Additional Information/Context

No response

SDK version used

3.369.9

Environment details (Version of PHP (php -v)? OS name and version, etc.)

PHP 8.3.28

Activity

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

Metadata

Metadata

Labels

bugThis issue is a bug.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions