Zero-click Admin Takeover via Unguarded login_email
A People Manager could change an Admin's login_email field through the user PATCH endpoint even though the visible email field was protected, so the Admin's one-time login code was sent to the attacker's mailbox. The attacker could then log in as the Admin without any action from the victim.
medium.com
Published on medium.com
Been meaning to write this one up since December. It’s a HR platform, name left out, and the bug is one of those ones where you can tell someone actually thought about the problem and still missed.
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
The authorisation check and the UI lock were applied to the display email field rather than the login_email field that the authentication flow actually uses.
Impact
An attacker with a People Manager account could take over an Admin account without any interaction from the victim, gaining full control including over the role model.
What the attacker needed
A People Manager account; knowledge of the Admin's user ID
The fix
The login_email field should be protected by the same server-side authorisation check as the display email field, and the UI should not leave it unmentioned.
How it was found
- Create a People Manager account and log in.
- Open the Admin's profile and note that the email field is greyed out with a padlock.
- Intercept the profile save request and try changing the email field, which is rejected by the server.
- Send the same PATCH request again but change the login_email field instead, which succeeds.
- Go to the login page and enter the attacker's email address.
- Receive the Admin's one-time login code in the attacker's inbox and log in as the Admin.
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.
This app has no passwords: you enter your email address and it sends a one-time code to that address, so whoever controls the address can log in. The site hid the email field on the profile page and blocked changes to it, but the account also stored a second, hidden email field that the login system actually used. A lower-level HR user could change that hidden field on an admin's account, so the admin's login code arrived in the attacker's inbox.
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.