How I Found a CSRF Vulnerability in Profile Picture Deletion
The profile picture deletion endpoint lacked CSRF protection, allowing an attacker to craft a malicious request that, when clicked by a logged-in user, would delete their profile picture without consent.
Published on medium.com
In this article, I’ll share a critical Cross-Site Request Forgery (CSRF) vulnerability I discovered on a web application (masked as redacted) that allowed unauthorized deletion of a user’s profile picture. While the impact may seem minor at first glance, it highlights the importance of implementing proper server-side…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the server did not require a CSRF token or validate the Origin/Referer header for the profile picture deletion request.
Impact
An attacker could delete a logged-in user's profile picture without consent, affecting data integrity and user experience, though the impact is limited to that action.
What the attacker needed
Victim is logged in; victim clicks a link or button
How it was found
- Create a user account and set a profile picture.
- Navigate to the profile section and select the option to delete the profile picture.
- Intercept the HTTP request for deleting the profile picture using Burp Suite.
- Craft a malicious HTML form that sends a POST request to the vulnerable endpoint.
- Send the PoC to the victim (e.g., via email or embedding it in a malicious website).
- If the victim is logged in and clicks the submit button, their profile picture is deleted.
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 write-up has not been written yet. The Original tab links to the source.
Cross-Site Request Forgery (CSRF) is when a malicious website tricks your browser into sending a request to another site where you are logged in, without you intending to. Here, the attacker made a form that, when submitted, told the victim's account to delete its profile picture. The site did not check that the request really came from its own pages.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.