21025: Handle api_token as a list throughout keep-web handler 21025-keep-web-redirect-bypass
authorBrett Smith <brett.smith@curii.com>
Thu, 26 Oct 2023 20:13:31 +0000 (16:13 -0400)
committerBrett Smith <brett.smith@curii.com>
Thu, 26 Oct 2023 20:13:31 +0000 (16:13 -0400)
commit9b9ada224856e289cdd9e81954c4ea3c3bc1fe68
tree913d8b6eb7c27555c0012de9b18a652a0af134ae
parentc9125cabaeb7a345f9180db5b9f6442b1c091f07
21025: Handle api_token as a list throughout keep-web handler

The previous code used `Request.FormValue("api_token") == ""` to
determine whether or not an API token was provided. However, this empty
string value could be returned both when there was no API token, or if
an attacker explicitly passed `api_token=`. An attacker could take
advantage of this flattening to bypass the intended redirect and
introspect API tokens in the URL.

Arvados-DCO-1.1-Signed-off-by: Brett Smith <brett.smith@curii.com>
services/keep-web/handler.go
services/keep-web/handler_test.go