ADVANCED XSS AND CSRF EXPLOITATION MODULE
In the section Misc CSRF Exploitation, we discuss the CSRF exploitation if there is a client side redirect, even if the Session cookies are set with Samesite Strict, the cookies will be send with redirect. That makes sense as the application itself makes the redirect to a State changing URL ( endpoint should allow state change through GET request? ).
But my doubt is
Suppose I have a malicious website that has the below script
<script>
document.location = "http://vulnerablesite.htb/admin.php?user=htb-stdnt%26promote=htb-stdnt";
</script>
The working is /admin.php has meta
tag which redirects the user to /profile.php + the part you gave inside user parameter so it’ll be
/profile.php?user=htb-stdnt&promote=htb-stdnt
( If successful it’ll promote the user inside promote param as admin )
The application initiates a cross-origin request to /admin.php.
But since cookie is set with Samesite Strict the cookies won’t be sent and it should redirect to /login.php in most case as you are not authenticated.
I get that if you are authenticated, the redirect happens ( vuln app makes it ) so it is samesite so cookies will be send to /profile.php. But at the first place the first request which is to /admin.php, cookies are not send so it should redirect to login.php.