Skip to content
Account takeover Write-up Intermediate

How I Chained Mass Assignment + PHP Type Juggling to Take Over Any Account on a Live Platform —…

The password reset endpoint accepted an attacker-supplied user ID and used a loose comparison for the reset token, allowing an unauthenticated attacker to change any user's password by sending a boolean true as the token. This enabled account takeover, including administrative accounts.

AnGrY Follow

Published on medium.com

While hunting on a private program, I came across console-api.redacted.com — the backend API for a digital advertising platform. A quick look at their production JavaScript bundle revealed something interesting: a list of endpoints that intentionally required no authentication.

AnGrY, 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 endpoint used mass assignment to accept an arbitrary user ID and compared the reset token with a loose equality operator, so a boolean true bypassed the check.

Impact

An unauthenticated attacker could reset the password of any user account, including administrative accounts, leading to full account takeover and access to sensitive advertiser data; the impact was initially rated Critical but later downgraded to Medium by the triage team.

What the attacker needed

No authentication required; Knowledge of a valid numeric user ID

The fix

The endpoint was fixed by enforcing that the token is a required string, moving user lookup to be driven by the token instead of an attacker-supplied ID, and adding password length and required-field validation.

How it was found

  1. Send a request to the reset-password endpoint with a valid user ID and observe a different error than for an invalid ID, confirming user enumeration.
  2. Send a request with a boolean true as the remember_token value along with a new password.
  3. Observe a success response and confirm the password was changed.
  4. Test other token types (string, integer, empty string, null, omitted) to confirm only boolean true bypasses the check.
  5. After a silent patch blocked boolean true, send an array containing false as the token to bypass the incomplete fix.

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 let you change your own password after proving you received a secret link by email. Here, the server trusted a number the attacker sent to pick the account, and it checked the secret token in a way that treated the word 'true' as a valid token. So anyone could reset anyone else's password without logging in.

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.

More by AnGrY

View all

1 more disclosed report, best first.

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.