[www.drive2.ru] CSRF through FCTX token bypass
The login page accepted a POST without a valid anti-CSRF token and also allowed the rememberMe field to contain HTML, so an attacker could force a victim to log in as the attacker and inject script through that field. The report claims login CSRF and possible XSS linkage, but the exploit depends on a valid reCAPTCHA response.
- Fixed in 2 hours
- Disclosed after 3 hours
Summary by the program
During login on the login page, login is attempted through the FCTX token. In addition, the login page was implemented through g-recaptcha-response captcha, but an attacker can bypass g-recaptcha-response captcha without FCTX tokens, and login CSRF is possible.
The issue was fixed by enabling the missing anti-CSRF token validation.
Summary by the researcher
Many developers do not implement CSRF tokens on their login page. This doesn't have a big impact on security, but the CSRF token is implemented in Drive2, but the CSRF token is missing and XSS linkage was possible during login. XSS is performed through the rememberMe variable during login.
##PoC
<html>
<body>
<form action="https://www.drive2.ru/reception/?.AMRU=https%3A%2F%2Fwww.drive2.ru%2F" method="POST">
<input type="hidden" name="login" value="youremail" />
<input type="hidden" name="password" value="yourpassword" />
<input type="hidden" name="rememberMe" value="<img src=x onerror=alert(document.domain)>"/>
<input type="hidden" name="g-recaptcha-response" value="03AHaCkAaaWRVYvbxavoJwreHHcF7LYNyq7A2sokgDWogNTXpwfoJqOvg-0NWV3rpXGmRJIbJsDz-7WBbxcTnXQcHFUlJXEjZlV1MlzKhR90lnCK0f6H0hapfn8ntpkb4yrxGL1rO8pEYIesSxN9n_KzKcLiehwQntUANUgt4fNDWXPodZI8uiaAxlUFvHX7TqctiVxAweCXIuOKxqcFZcU7MQYV06ZeCWLaisH7vxL36gR64Uq0Uq57vacU4Wr6wWbHt_eGuCzrFaXhQHeW43bBCqRhCwQj_ht1BFvf9MoX9_BDG7q7bdkag2x6P80nLqA46feChNVBFMJQ_3M3cAtcm5kdfzOELRkmJ6nHoCe3VPW7yYc5jHSexYxj8G9DwMA1Qy4tpTWc4F" />
<input type="submit" value="Submit request" />
</form>
</body>
</html>
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the login endpoint did not validate the anti-CSRF token and did not sanitise the rememberMe value before rendering it.
Impact
An attacker could log a victim into the attacker's account and, if the rememberMe value is rendered unsafely, run script in the victim's browser; the report does not show that the reCAPTCHA check was actually bypassed.
What the attacker needed
Attacker has an account; victim visits attacker page
The fix
The issue was fixed by enabling the missing anti-CSRF token validation.
How it was found
- Create a page with a form that posts to the login endpoint.
- Set the login and password fields to the attacker's credentials.
- Put an HTML image tag with an error handler in the rememberMe field.
- Include a reCAPTCHA response value in the form.
- Submit the form so the victim's browser sends the login request.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A login form should include a secret, one-time value (a CSRF token) so that another website cannot silently submit the form on your behalf. Here the form did not properly check that value, and one field (rememberMe) was later shown on the page without cleaning, so script could run. The report says this could let an attacker log you into their account or run code in your browser.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.