Skip to content
Access control Write-up Intermediate

Ghost in the System: A Zero-Click Path to Owning Any User Account

An admin API endpoint returned any user's data to a normal authenticated user, and the same endpoint accepted PATCH requests that let the attacker change any user's email address. By changing the victim's email to their own, the attacker could trigger a password reset and take over the account without any action from the victim.

medium.com

Published on medium.com

In a previous write-up MEDIUM, a friend detailed how we found a leaky admin endpoint on “domain.com” that exposed user transaction data.

Ln0rag, on medium.com

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 admin user endpoint performed no role or ownership check on either GET or PATCH requests, so any authenticated user could read and modify arbitrary user records.

Impact

An authenticated attacker could read any user's private data and take over any account by changing its email and resetting the password, with no interaction needed from the victim.

What the attacker needed

A free account; knowledge of a victim user ID; no victim interaction needed

How it was found

  1. Find the admin user endpoint while reviewing the site's JavaScript and API structure.
  2. Request your own user record through the admin endpoint using a normal non-admin token and see it succeed.
  3. Swap in another user's ID and confirm their data is returned.
  4. Change the request method to PATCH and modify another user's profile fields.
  5. Replace the victim's email address with your own and confirm the change is accepted.
  6. Use the forgot-password flow for the victim's username, receive the reset email, and set a new password.

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.

A website should check not just that you are logged in, but also whether you are allowed to see or change a particular record. Here the server skipped that check on an admin-only address, so any logged-in user could read and edit other people's profiles. Because the email address could be changed, the attacker could then use the normal 'forgot password' flow to receive the reset link and set a new password.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.