Skip to content

aws_sigv4: '+' and space in query get both encoded to %20 #20543

Closed

Description

@nunojpg
No description provided.

Activity

  1. changed the title [-]aws_sigv4: issue with multiple parameters separator & vs &amp[/-] [+]aws_sigv4: '+' and space in query get both encoded to %20 due to two passes of encoding functions[/+] on Feb 8, 2026
  2. changed the title [-]aws_sigv4: '+' and space in query get both encoded to %20 due to two passes of encoding functions[/-] [+]aws_sigv4: '+' and space in query get both encoded to %20[/+] on Feb 8, 2026
  3. bagder commented on Feb 9, 2026

    @bagder
    Member

    The code quite deliberately "normalizes" + (and space) to %20 when part of the query.

    Can you find any documentation that clearly states how those are supposed to be handled?

  4. nunojpg commented on Feb 9, 2026

    @nunojpg
    Author

    https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html

    The space character is a reserved character and must be encoded as "%20" (and not as "+").

    There is nothing special on sigv4, they just don't want you to encode spaces as +, as we already don't do.

    The fix in the code was assuming we did that mistake before, and trying to fix it later. But that breaks the original '+', that was never a space!

    This is tested against AWS S3.

    Of course if both space and + get converted to %20 (which makes no sense!), it would be even a vector of attack of the API!

  5. bagder commented on Feb 9, 2026

    @bagder
    Member

    The space character is a reserved character and must be encoded as "%20" (and not as "+").
    There is nothing special on sigv4, they just don't want you to encode spaces as +, as we already don't do.

    but curl works on a URL provided by a user and then someone can use a + in the query part...

  6. nunojpg commented on Feb 9, 2026

    @nunojpg
    Author

    This is what I am trying to do. I need a + in the query parameter. And it stopped working when that code was added in 8.14 or so.

  7. added a commit that references this issue on Feb 9, 2026
    cb2d417
  8. added a commit that references this issue on Feb 10, 2026
    ee3a4df
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions