Skip to content
Account takeover Write-up Intermediate

️Breaking a PHP App with Nothing But Cookies and XML

The password reset endpoint accepted a user identifier supplied by the client, so a logged-in user could reset the password of any other account, including the administrator. The author also began probing an XML-based event feature for injection but the text stops before showing any exploitation.

medium.com

Published on medium.com

The app is clearly written in PHP, and I noticed a “Settings” tab linked to /settings.php — a password reset page.

Jabaribrown, 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

Impact

Any logged-in user could reset another account's password, including the administrator's, leading to full account takeover; the text does not describe any defence that limited this.

What the attacker needed

A valid low-privilege account; ability to send crafted requests

The fix

The reset endpoint should derive the target account from the authenticated session and bind the CSRF token to that same user, rather than accepting a user identifier from the request.

How it was found

  1. Log in with the provided account and note the redirect to the profile page
  2. Inspect the frontend code and see that a cookie named uid drives an API call for user data
  3. Fuzz the user API path with Burp Intruder to enumerate accounts and find the admin identifier
  4. Fetch a CSRF token from the token endpoint
  5. Send a reset request containing the admin identifier, the author's own token and a chosen password
  6. Log in as the administrator with the 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 password reset form should only ever change the password of the person who is logged in. Here the app trusted a number sent by the browser to decide whose password to change, so changing that number let the author take over the administrator account. The author then started looking at a feature that accepts XML, a structured text format, but the write-up ends before anything is shown.

What is Account takeover?

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.

Similar reports

View all

Same bug class and techniques, clearest first.

Account takeover

The lesson behind this report.

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.