This bug is very easy, and you can reproduce it easily and quickly.
Let me walk you through what I did step by step.
The /api/profile/<profile_id> endpoint used for avatar uploads via URL does not validate that the profile_id matches the authenticated user’s session. This leads to an Insecure Direct Object Reference (IDOR) vulnerability, allowing unauthorized access and modification of other users’ profile data.
I first tried sending a GET request with a random profile ID the server responded with JSON containing the user’s email a Gmail address.
That was a goldmine of sensitive information, exposed without any permission checks.
Next, I crafted a PUT request to update the victim’s email to one I controlled
PUT /api/profile/32142141
Authorization: Bearer <my_token>
Content-Type: application/json
{
“email”: “[email protected]”,
“bio”: “Hacked Account”
}
Because the backend didn’t verify ownership of profile_id, the email update succeeded.
With the victim’s email changed to my own, I triggered the password reset flow.
Since the reset email now went to my attacker controlled address, I reset the victim’s password and gained full access.
Impact
Full account takeover by exploiting missing authorization.
Disclosure of emails through unprotected GET requests.
Modification of profile data without user consent.
How to Fix This
Always authorize requests confirm that the logged-in user owns the profile_id before returning or modifying data.
Derive user identity from the authentication token don’t trust client supplied IDs.
Protect sensitive operations like email changes with verification workflows.
This IDOR is a textbook example of how small oversights can lead to massive security risks, when testing APIs, never assume that user IDs passed in URLs or request bodies are safe to trust.
Always test access controls thoroughly your findings could save users from devastating account takeovers.









Comments (0)