Organization Admin Privilege Escalation To Owner
An admin in an organization could change their own role to owner, allowing them to take full control and remove the original owner. The attacker could then kick the original owner out of the organization.
Originally disclosed on HackerOne
- Triaged in 2 hours
- Fixed in 2 hours
- Disclosed after 30 days
##Summary It seems there is an issue with your roles which allows an admin to escalate his own privileges to owner and takeover the organization.
##Reproduce
- Create an account, accountA
- Create another account, accountB
- Create an organization under accountA and invite accountB to that organization as admin
- Accept invitation with accountB and log out
- Confirm accountB for the organization on accountA
- Log in with accountB
- Navigate to the organization -> invite users -> edit accountB user and change to owner
- See that the change worked and accountB is now owner.
- To proceed with organization takeover, remove the original owner
- Note that (after login and logout) the original owner no longer is in the organization
##Impact Anyone who is an admin on an organization can take total control of the organization and kick the original owner out.
##Request Could you please whitelist ip 173.167.43.57 and ip 54.197.209.98 so that I can keep reporting? It is very hard to fully test the application while I am constantly getting blacklisted and having to use my phone as a hotspot :P If not, that's cool, just figured I'd ask :)
Thanks, Justin Gardner
Context
Bitwarden is a password manager, and vault.bitwarden.com is the web vault where users manage their items and, importantly, their organisations. An organisation is a shared vault with a membership model: users are invited, and each member holds a role. The roles that matter here are admin and owner. An admin is meant to manage users and day-to-day organisation settings, while the owner is the account that ultimately controls the organisation, including the ability to remove other members.
The report describes a business logic flaw in that role model: an admin can change their own role to owner, and then remove the original owner. The weakness is classified as a business logic error and was rated medium severity.
Setup
The researcher needed two ordinary accounts and one organisation. No special tooling, proxy tricks or version-specific behaviour are described; the whole flow is performed through the normal web interface.
Preconditions:
- Two accounts, referred to as
accountAandaccountB. - An organisation created under
accountA, which makesaccountAthe owner. accountBinvited to the organisation with the admin role.
Finding it
The researcher's summary is that the role handling allows an admin to escalate their own privileges to owner and take over the organisation. The interesting part is not a malformed request or a bypassed check on an unusual endpoint: it is that the user-editing screen, which an admin legitimately uses to manage other members, also lets the admin edit their own membership and select the owner role. In other words, the privilege boundary between admin and owner is enforced (or rather, not enforced) at the point where a role is assigned, and nothing prevents the actor from being the target of that assignment.
Exploitation
Step 1: Create the two accounts
Create accountA, then create a second account, accountB. These are the owner-to-be and the admin-to-be respectively.
Step 2: Create the organisation and invite the admin
Under accountA, create an organisation. accountA is now the owner. Invite accountB to that organisation with the admin role.
Step 3: Accept the invitation and log out
Accept the invitation while logged in as accountB, then log out. Logging out at this point matters because the next step is performed as the owner.
Step 4: Confirm the invited account as the owner
Still as accountA, confirm accountB for the organisation. This is the normal confirmation step that activates the invited membership.
Step 5: Log in as the admin
Log in with accountB. At this point accountB is an active admin of the organisation, not an owner.
Step 6: Edit your own membership and pick the owner role
Navigate to the organisation, then to invite users, and edit the accountB user entry, changing the role to owner. The report gives no request or response for this action; the change is made through the user interface.
Step 7: Observe the escalation
The change works: accountB is now owner of the organisation. The role assignment was accepted for the admin's own account.
Step 8: Remove the original owner
To complete the takeover, remove the original owner, accountA, from the organisation. As owner, accountB has the authority to do this.
Step 9: Confirm the takeover
After logging out and back in, the original owner is no longer in the organisation. The original owner is no longer in the organisation.
Root cause
An admin can therefore grant the owner role, including to their own membership. Because owner outranks admin, the assignment immediately gives the admin the power to remove the original owner, and nothing in the flow stops that removal.
Impact
Anyone who is an admin on an organisation can take total control of that organisation and remove the original owner. The report does not describe any further consequences, such as access to the organisation's stored vault items, so the stated impact is control of the organisation and eviction of its owner.
Fix
The report does not state what was changed. Based on the flaw, the role assignment should be restricted so that only an owner can grant the owner role, and a member should not be able to raise their own role. Whether the fix was applied server-side or in the interface is not described.
Variants to test
- Self-role change on other membership screens. On any product with team or organisation roles, try editing your own membership and selecting a higher role. A positive result is the interface accepting the change and your session showing the elevated role after a re-login.
- Admin assigning owner to a second admin. Invite a third account as admin, then, as the first admin, try to promote the third account to owner. A positive result is the promotion succeeding without an owner's involvement.
- Role value tampering. Where the role is submitted as a parameter, change it to the highest privileged value and observe whether the server rejects it. A positive result is a successful response and a persisted change.
- Owner removal by a non-owner. As an admin, attempt to remove the owner directly. A positive result is the owner disappearing from the member list.
- Re-login persistence. After any suspected escalation, log out and back in and re-check the role and membership list, since the report's final confirmation relies on exactly this.
Hunting notes
This kind of bug hides in multi-tenant membership management: invitation flows, role dropdowns, member editing screens and any place where a role is chosen from a list. The signal during recon is a product with more than two privilege levels where the same screen is used both to manage others and to view or edit yourself. The researcher demonstrated impact by carrying the escalation through to its conclusion: promoting the admin account, removing the original owner, and showing after a fresh login that the original owner was gone.
What happened, in plain words
Bitwarden is a password manager: a service that stores your passwords and other secrets in an encrypted vault. vault.bitwarden.com is its web vault, the website where you log in to manage your items and, importantly, your organisations. An organisation is a shared vault for a group of people, such as a company or a family. People are invited to join, and each member has a role. Two roles matter here: admin and owner. An admin is meant to manage users and day-to-day settings, while the owner is the account that ultimately controls the organisation, including the power to remove other members.
The report describes a flaw in that role model: an admin can change their own role to owner, and then remove the original owner. The weakness is classified as a business logic error and was rated medium severity.
Setting up
The researcher needed two ordinary accounts and one organisation. No special tools, proxy tricks or version-specific behaviour are described; the whole flow is performed through the normal web interface.
Preconditions:
- Two accounts, referred to as
accountAandaccountB. - An organisation created under
accountA, which makesaccountAthe owner. accountBinvited to the organisation with the admin role.
Finding it
The researcher's summary is that the role handling allows an admin to escalate their own privileges to owner and take over the organisation. The interesting part is not a malformed request or a bypassed check on an unusual endpoint: it is that the user-editing screen, which an admin legitimately uses to manage other members, also lets the admin edit their own membership and select the owner role. In other words, the privilege boundary between admin and owner is enforced (or rather, not enforced) at the point where a role is assigned, and nothing prevents the actor from being the target of that assignment.
Exploitation
Step 1: Create the two accounts
Create accountA, then create a second account, accountB. These are the owner-to-be and the admin-to-be respectively.
Step 2: Create the organisation and invite the admin
Under accountA, create an organisation. accountA is now the owner. Invite accountB to that organisation with the admin role.
Step 3: Accept the invitation and log out
Accept the invitation while logged in as accountB, then log out. Logging out at this point matters because the next step is performed as the owner.
Step 4: Confirm the invited account as the owner
Still as accountA, confirm accountB for the organisation. This is the normal confirmation step that activates the invited membership.
Step 5: Log in as the admin
Log in with accountB. At this point accountB is an active admin of the organisation, not an owner.
Step 6: Edit your own membership and pick the owner role
Navigate to the organisation, then to invite users, and edit the accountB user entry, changing the role to owner. The report gives no request or response for this action; the change is made through the user interface.
Step 7: Observe the escalation
The change works: accountB is now owner of the organisation. The role assignment was accepted for the admin's own account.
Step 8: Remove the original owner
To complete the takeover, remove the original owner, accountA, from the organisation. As owner, accountB has the authority to do this.
Step 9: Confirm the takeover
After logging out and back in, the original owner is no longer in the organisation. The original owner is no longer in the organisation.
Root cause
An admin can therefore grant the owner role, including to their own membership. Because owner outranks admin, the assignment immediately gives the admin the power to remove the original owner, and nothing in the flow stops that removal.
Impact
Anyone who is an admin on an organisation can take total control of that organisation and remove the original owner. The report does not describe any further consequences, such as access to the organisation's stored vault items, so the stated impact is control of the organisation and eviction of its owner.
Fix
The report does not state what was changed. Based on the flaw, the role assignment should be restricted so that only an owner can grant the owner role, and a member should not be able to raise their own role. Whether the fix was applied server-side or in the interface is not described.
Variants to test
- Self-role change on other membership screens. On any product with team or organisation roles, try editing your own membership and selecting a higher role. A positive result is the interface accepting the change and your session showing the elevated role after a re-login.
- Admin assigning owner to a second admin. Invite a third account as admin, then, as the first admin, try to promote the third account to owner. A positive result is the promotion succeeding without an owner's involvement.
- Role value tampering. Where the role is submitted as a parameter, change it to the highest privileged value and observe whether the server rejects it. A positive result is a successful response and a persisted change.
- Owner removal by a non-owner. As an admin, attempt to remove the owner directly. A positive result is the owner disappearing from the member list.
- Re-login persistence. After any suspected escalation, log out and back in and re-check the role and membership list, since the report's final confirmation relies on exactly this.
Hunting notes
This kind of bug hides in multi-tenant membership management: invitation flows, role dropdowns, member editing screens and any place where a role is chosen from a list. The signal during recon is a product with more than two privilege levels where the same screen is used both to manage others and to view or edit yourself. The researcher demonstrated impact by carrying the escalation through to its conclusion: promoting the admin account, removing the original owner, and showing after a fresh login that the original owner was gone.
Glossary
- Admin: a member role that can manage users and day-to-day organisation settings, but is not meant to control the organisation ultimately.
- Business logic error: a flaw in the rules or workflow of an application, rather than in its code-level defences, that lets someone do something the designers did not intend.
- Cookie: a small piece of data a website stores in your browser to remember who you are between requests.
- Endpoint: a specific URL or address in an application that performs a particular action when called.
- Escalate: to increase your own level of access or privileges.
- IP address: a numeric address that identifies a device on a network.
- Multi-tenant: a system where many separate groups (tenants) share the same application while keeping their data and settings apart.
- Organisation: a shared vault in Bitwarden with its own members and roles.
- Owner: the highest role in an organisation, with ultimate control, including the ability to remove other members.
- Parameter: a named value sent with a request, such as a role name, that the server uses to decide what to do.
- Privilege: a permission to perform certain actions.
- Proxy: a tool that sits between your browser and the server, letting you inspect and modify requests.
- Role: a label attached to a member that determines what they are allowed to do.
- Server: the computer that runs the application and responds to requests from your browser.
- Session: the period during which you are logged in, identified by a cookie or token.
- Token: a piece of data, often a long string, that proves your identity or authorises a request.
- Vault: the encrypted storage area in a password manager where items are kept.
- Web vault: the website version of the vault, accessed through a browser.
- Whitelist: to explicitly allow something, such as an IP address, through a filter that would otherwise block it.