You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 21, 2025. It is now read-only.
Scenario:
Using github.com/awslabs/aws-lambda-go-api-proxy within github.com/aws/aws-lambda-go/lambda behind an multi_value_headers-enabled ALB
Issue:
URL-Query Parameters can be double-url encoded.
For example a /?from=2022-09-20T04:11:02 would be url-encoded by the browser to /?from=2022-09-20T04%3A11%3A02 (as %3A is the url-encoding of :).
Because of https://github.com/awslabs/aws-lambda-go-api-proxy/blob/master/core/request.go#L164 this value is encoded again before it reaches the handler. Instead of from=2022-09-20T04%3A11%3A02 a double-url encoded value is passed to the handler: from=2022-09-20T04%3A11%253A02 (as %25 is the url-encoding of %).
Suggested solution:
Using url.QueryUnescape before encoding, to see whether the query parameter is already encoded (this would result in err != nil).
The text was updated successfully, but these errors were encountered:
elgohr
added a commit
to elgohr/aws-lambda-go-api-proxy
that referenced
this issue
Oct 8, 2022
If you enable multi-value headers, the load balancer uses both cookies sent by the client and sends you an event that includes headers using multiValueHeaders. For example:
Uh oh!
There was an error while loading. Please reload this page.
Scenario:
Using
github.com/awslabs/aws-lambda-go-api-proxy
withingb.xjqchip.workers.dev/aws/aws-lambda-go/lambda
behind anmulti_value_headers
-enabled ALBIssue:
URL-Query Parameters can be double-url encoded.
For example a
/?from=2022-09-20T04:11:02
would be url-encoded by the browser to/?from=2022-09-20T04%3A11%3A02
(as%3A
is the url-encoding of:
).Because of https://github.com/awslabs/aws-lambda-go-api-proxy/blob/master/core/request.go#L164 this value is encoded again before it reaches the handler. Instead of
from=2022-09-20T04%3A11%3A02
a double-url encoded value is passed to the handler:from=2022-09-20T04%3A11%253A02
(as%25
is the url-encoding of%
).Suggested solution:
Using
url.QueryUnescape
before encoding, to see whether the query parameter is already encoded (this would result in err != nil).The text was updated successfully, but these errors were encountered: