Cracking the Code: How I Took Over Admin Accounts Across Organiza
An administrator of one organisation could edit or delete users in any other organisation because the server trusted a client-supplied organisation identifier while using a user identifier from a different organisation. An attacker could downgrade an admin's role, change their display name and email address, or delete their account.
Published on medium.com
It’s Esmail AKA 0xSp1DeR, and today I’ll be sharing the details of a critical vulnerability I recently found.
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 server authorised the request based on the supplied orgId but did not verify that the userId belonged to that organisation, and user IDs were predictable.
Impact
An attacker could downgrade an admin's role, change their display name and email address, or delete their account across organisations, and could enumerate user IDs to target high-privileged accounts.
What the attacker needed
An admin account in one organisation; knowledge of a target user ID
The fix
The server should verify that the userId belongs to the organisation identified by orgId before allowing any update, and user IDs should not be predictable.
How it was found
- Create an organisation and assign yourself as admin.
- Invite another user with a lower privilege role.
- Capture the edit request and try to modify the admin account as the lower-privileged user; the server returns 403.
- Create a second organisation and retrieve both userId and orgId.
- Modify the request with the new IDs; the server returns 500.
- Use your own organisation's orgId but change the userId to that of a user in the other organisation; the request returns 200 OK.
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.
The website let an admin change other users' details, but it checked only the organisation ID sent by the browser, not whether the user ID belonged to that organisation. So an admin could put their own organisation ID with someone else's user ID and still make changes. The user IDs were also predictable, so an attacker could guess other people's IDs.
What is IDOR?
One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.