CSRF - Modify User Settings with one click - Account TakeOver
The profile edit form lacked CSRF protection, so a malicious page could submit a forged request that changes the victim's username, email and password. An attacker who gets an authenticated victim to load the page could take over the account.
Originally disclosed on HackerOne
- Triaged in under an hour
- Fixed in 2.0 years
- Disclosed after 2.1 years
Target Url https://█████
Summary: This CSRF is sensitive, similar to the old one #799855 , here attacker can change user name, email, and password with just one click from user. I think its severity should be greater than Medium (High) since it doesn't require any user interaction but only just being authenticated to the target url.
Step-by-step Reproduction Instructions
- Login to your account.
- To generate the html code: You can click on save button in edit Profile section and intercept the request -> Engagement Tools -> Generate CSRF PoC.
- Copy and paste the generated code to html file
<html>
<body>
<form action="https://███" method="POST" enctype="multipart/form-data">
<input type="hidden" name="action" value="save_info" />
<input type="hidden" name="password[original]" value="█████████" />
<input type="hidden" name="password[confirmed]" value="██████████" />
<input type="hidden" name="email[original]" value="███████" />
<input type="submit" value="Submit request" />
</form>
</body>
</html>
Open the file in browser, click the button and the profile info will be changed successfully.
Suggested Mitigation/Remediation Actions
Add a csrf-token in the header or in an hidden input to check if the user that is doing this action authorized or not.
Impact
This action is critical and sensitive. Attacker can upload this file to a url. Sends it to the victims. And when the authenticated victims navigate to the url their accounts details (username, email, password) will change. Attacker will undergo successful Account Takeover.
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
The profile save endpoint accepted state-changing POST requests without an anti-CSRF token.
Impact
An attacker could host the page and send it to a logged-in victim; when the victim loads it, their username, email and password would change, leading to account takeover.
What the attacker needed
Victim is logged in; victim visits attacker page
How it was found
- Log in to the target account.
- Submit the edit Profile form and intercept the save request.
- Generate a CSRF proof-of-concept from the intercepted request.
- Save the generated HTML to a file and open it in a browser.
- Click the submit button and observe the profile details change.
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.
When you are logged in, your browser automatically sends your session cookie with every request to that site. If a form accepts changes without a secret token that only the real site knows, another website can make your browser send that change for you. Here the profile form had no such token, so a page the attacker controls could quietly change the victim's login details.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.