CSRF token in url-encoded body is url-decoded twice
- Dominant language
- JavaScript
- Stars
- 226
- Forks
- 235
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 19
Description
1. by body-parser, and
2. by authHandler
Introduced in 36b97ff955bd81ff88e8bacff38137fc46aca960
-----
```sh
$ curl http://localhost:8383/v1/projects/1/forms/1/submissions.csv.zip -H 'Cookie: session=' -H 'x-forwarded-proto: https' -H 'content-type: application/x-www-form-urlencoded' --data '__csrf=%25ea'
{"message":"Internal Server Error"}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the failure with the provided curl request against the submissions.csv.zip endpoint, then trace how the url-encoded body moves through body-parser and authHandler. Confirm where the CSRF token is decoded twice; done means the same request no longer returns Internal Server Error because of the double decoding.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api, backend, security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100