When an Owner Can Kick Out Another Owner: A Real-World Authorization Flaw
A company Owner could remove another Owner through the member-deletion API, because the backend checked the requester's role but not the target's role. An invited Owner could therefore strip the original Owner of all company access while keeping full control themselves.
Cyber Security Awareness
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.
Context
While testing target.com, I came across an interesting business-logic issue in the company management functionality. The application has several company roles, including Owner, Manager, User, Guest, and Viewer. The Owner role has full access to the company.
The feature in question is member management: inviting people into a company, assigning them roles, and removing them again. Removal is performed through the backend API rather than only through the interface, which is what made the behaviour below observable.
Setup
I created two test accounts:
- Account A, which created the company and became the original Owner.
- Account B, which was invited by A and assigned the Owner role.
The company then looked like this:
Company → Account A (Owner) + Account B (Owner)
No special tooling is described beyond inspecting the API requests made by the member-management functionality while authenticated as each account.
Finding it
While testing the member-management functionality, I inspected the API requests and found that removing a company member is handled through:
DELETE /v1/company/<companyUid>/member/<memberUid>?companyUid=<companyUid>Host: api.target.com
The path carries both the company identifier and the identifier of the member to be removed, and the company identifier is repeated as a query parameter. The interesting question was whether the backend properly prevented one Owner from removing another Owner. The original notes that the application checks the requester's role correctly, but does not consider the role of the target. What was not obvious was whether the role of the member being deleted was considered at all.
Exploitation
Step 1: send the deletion as the second Owner
While authenticated as Account B, I sent the request targeting Account A's member ID:
DELETE /v1/company/<companyUid>/member/<A-memberUid>?companyUid=<companyUid>
The request was authenticated using B's legitimate Owner session. The server returned:
HTTP/2 204 No Content
So this wasn't just a frontend issue, the backend actually accepted the deletion. The request was the same as a normal member removal, except that the target member was itself an Owner.
Step 2: check what happened to the removed Owner
I then logged back into Account A. Authentication still worked, but A had lost access to the company. The application started returning authorization errors such as:
Company.Many.Fetch → insufficient privilegesOrganization.Many.FetchByUids → insufficient privilegesDevice.Many.FetchByUids → insufficient privilegesLocation.Many.FetchByUids → insufficient privileges
At the same time, Account B remained a Company Owner with full control.
The final state was:
Before: A = Owner, B = Owner
After B removes A: A = No Company access, B = Owner / Full control
Root cause
This is what makes the issue interesting: the backend correctly knows that A no longer has permission, but it allows B to perform the operation that caused this state in the first place.
An Owner can essentially say:
"I'm an Owner, so I can delete this member."
But the backend doesn't appear to enforce:
"Is the member being deleted also an Owner?"
In other words, the backend does not appear to check the role of the target being modified. The role of the target being modified is not part of the decision, so a peer with equal privileges is treated like any ordinary member. This means an invited Owner can remove another Owner and retain their own Owner privileges, potentially leaving themselves as the only administrator of the company.
This was a good reminder that authorization testing isn't always about finding a missing 403 (which takes time to figure out how to bypass it). Sometimes the application checks the requester's role correctly, but fails to consider the role of the target being modified.
Impact
Finding: Company Owner can remove another Company Owner through the backend API and retain full company control.
Impact: A malicious or compromised Owner can remove another Owner, causing them to lose administrative access while retaining control over the company's resources.
The other Owner's account continues to authenticate but is cut off from the company, potentially leaving the attacker as the only administrator.
Fix
The report does not describe a fix or a vendor response. Based on the root cause, the check that should be added is on the target: a member removal request should be rejected when the member being removed holds the Owner role, unless the caller is authorised to remove Owners specifically, for example through an explicit ownership-transfer or owner-removal flow.
Variants to test
- Peer-role deletion in other multi-tenant products. Repeat the two-account setup in any product with an admin or owner tier and try removing the peer through the API. A positive result is a success response for the deletion followed by the peer losing access while the caller keeps their role.
- Role change instead of removal. If the API exposes a role-update endpoint, try demoting a peer Owner to a lower role from an equal-privilege account. A positive result is the peer's privileges dropping while the caller's remain unchanged.
- Self-removal of the last Owner. Try removing yourself, or the only other Owner, and see whether the backend allows a company to be left without an administrator. A positive result is a company with no Owner left, or with the caller as the sole Owner after removing the peer.
- Identifier substitution. Change the
memberUidin the path, or thecompanyUidin the query string, to values belonging to another company you control. A positive result is the backend acting on the substituted identifier rather than validating that the member belongs to the company in the path. - Lower-privilege caller. Send the same deletion request from a Manager or User account against an Owner. A positive result is any response other than a permission error, which would show the requester-side check is weaker than assumed.
What happened, in plain words
A website lets a company have several people in it, each with a role such as Owner, Manager, User, Guest or Viewer. The Owner role is the top one: an Owner can do everything in the company. The researcher created two accounts, made both of them Owners of the same company, and then asked a simple question: can one Owner remove the other Owner from the company?
The answer was yes. Using the second account, the researcher sent the same request the website uses to remove an ordinary member, but pointed it at the first Owner. The server accepted it. The first Owner could still log in, but no longer had access to the company, while the second Owner kept full control.
The lesson is about a specific kind of mistake. The application checks the requester's role, but does not appear to check who is being removed. It did not check who was being removed. So an Owner was treated as a normal member to be deleted, even though an Owner is not a normal member.
Background ideas you need first
Before the steps make sense, a few everyday ideas.
A website is two programs talking. One runs in your browser (the part you see and click) and one runs on the company's server (the part you never see). The browser asks, the server answers. The browser part is often called the frontend, the server part the backend.
An API is the menu the server offers. Think of a restaurant. You do not walk into the kitchen; you pick from a menu and a waiter carries your order. An API is that menu plus the waiter: a fixed list of requests the browser is allowed to send to the server, each with a name and a shape. When you click "Remove member" on a web page, the browser sends one of these requests for you. You can also send the same request yourself, by hand, with a tool, which is what security testers do.
A request has a method, a path and sometimes a body. The method is the verb: GET means "give me something", DELETE means "remove something". The path is the address of the thing you are acting on, like a street address. The body is extra data, like a note attached to the order.
A session is how the server remembers who you are. Web pages do not resend your password on every click. Instead, after you log in, the server gives your browser a small piece of text (a cookie or a token) that it recognises on later requests. Think of a cloakroom ticket: you hand in your coat once, and the ticket proves the coat is yours each time you come back. Every request described below carried the tester's ticket, so the server knew which account was asking.
A role is a label that decides what you may do. In an office, a manager can open the stationery cupboard and an intern cannot. In this product, Owner, Manager, User, Guest and Viewer are such labels, and Owner is the one with the keys to everything.
Authorisation is the check of whether you are allowed. Authentication answers "who are you?". Authorisation answers "are you allowed to do this?". Most security bugs of this family are authorisation bugs: the server knows exactly who you are and still lets you do something you should not.
A business-logic flaw is a rule the software forgot. The code runs without crashing and every technical check passes, but the rule the company intended ("one Owner must not be able to throw out another Owner") was never written down in the code. Nothing is broken in the plumbing; the policy is missing.
HTTP status codes are the server's short replies. 200 usually means "here is your data", 204 means "done, and there is nothing to send back", 403 means "you are not allowed". Testers often hunt for a missing 403, meaning a place where the server should have refused and did not.
The target and the feature
The researcher was testing a site referred to as target.com. The feature under test was company management: a company has members, each member has a role, and an administrator can invite people, assign roles and remove people again.
Removing a member is not done only by clicking a button in the page. The page sends a request to the backend API, and that request is what actually performs the removal. This matters because the page can hide a button from you, but the API behind it is still reachable. If the server does not check permissions itself, hiding a button protects nothing.
Setting up two accounts
The researcher created two accounts:
- Account A, which created the company and so became the original Owner.
- Account B, which was invited by A and was given the Owner role.
The company then looked like this:
Company → Account A (Owner) + Account B (Owner)
Two Owners, equal in power. This setup is the whole experiment: to test whether one Owner can act against another, you first need two of them. The researcher then watched the requests the member-management pages made while logged in as each account, using the browser's developer tools (the panel that shows every request a page sends). No other tooling is described.
Finding the request
While testing member management, the researcher inspected the requests and found that removing a member is handled by this one:
DELETE /v1/company/<companyUid>/member/<memberUid>?companyUid=<companyUid>Host: api.target.com
Line by line:
DELETEis the verb: this request asks the server to remove something./v1/company/<companyUid>/member/<memberUid>is the path.v1is a version label in the address.<companyUid>is a placeholder for the company's unique identifier, and<memberUid>is a placeholder for the member's unique identifier. A UID is just a long unique name for a record, so the server can tell one company or one member from another.?companyUid=<companyUid>is the query string, the part after the question mark. Here the company identifier is repeated, which is common in APIs and worth noticing.Host: api.target.comsays which server the request is addressed to. Theapi.prefix is a common way to name the server that answers API requests, as opposed to the one that serves web pages.
The question the researcher wanted answered: does the backend stop one Owner from removing another Owner? The original notes that the application checks the requester's role correctly, but not the role of the member being removed. What was unclear was whether the server looks at the role of the member being removed.
Step 1: send the deletion as the second Owner
Logged in as Account B, the researcher sent the same request, but with Account A's member identifier in the place of the member to remove:
DELETE /v1/company/<companyUid>/member/<A-memberUid>?companyUid=<companyUid>
Line by line:
- The verb and the path shape are unchanged from the normal removal request. Nothing exotic was added.
<A-memberUid>is the identifier of Account A, the other Owner. That single substitution is the entire test: an ordinary member identifier replaced by an Owner's identifier.- The request was sent with B's own valid session, so the server saw a genuine Owner asking. There was no forgery, no stolen ticket, no trick in the request itself.
The server replied:
HTTP/2 204 No Content
Line by line:
HTTP/2is the version of the web protocol used for the conversation.204is a success code meaning "done, and there is nothing to send back". A removal has nothing to return, so this is the expected success answer.No Contentis the human-readable name of that code.
A success code here means the backend really accepted the deletion, so this was not just a frontend issue. It did not. The only thing that made this request different from a normal member removal was that the target was itself an Owner.
Step 2: check what happened to the removed Owner
The researcher logged back into Account A. Logging in still worked, so the account itself was intact. But A had lost access to the company. The application began returning authorisation errors:
Company.Many.Fetch → insufficient privilegesOrganization.Many.FetchByUids → insufficient privilegesDevice.Many.FetchByUids → insufficient privilegesLocation.Many.FetchByUids → insufficient privileges
Line by line:
- Each line names an operation the page tried to perform: fetching companies, fetching organisations by their identifiers, fetching devices, fetching locations. These are internal names for the data the company page loads.
insufficient privilegesis the server's way of saying "you are not allowed to see this". The account is recognised, but it is no longer a member of the company, so the company's data is closed to it.
Meanwhile Account B was still a Company Owner with full control. The end state was:
Before: A = Owner, B = Owner
After B removes A: A = No Company access, B = Owner / Full control
Why it works
The interesting part is the contradiction. The backend knows perfectly well that A is no longer allowed in, and says so with those privilege errors. Yet it allowed B to perform the very operation that created that state.
Put as two sentences an Owner might say:
"I'm an Owner, so I can delete this member."
That one the server checks, and it is true.
"Is the member being deleted also an Owner?"
That one the server does not appear to ask.
In other words, the backend does not appear to check the role of the person being acted on. The role of the person being acted on is not part of the decision, so an equal is handled like any ordinary member. An invited Owner can therefore remove another Owner and keep their own Owner privileges, potentially ending up as the only administrator of the company.
This is a useful reminder that authorisation testing is not only about finding a missing 403, which often takes time to figure out how to bypass. Sometimes the application checks the requester's role correctly and simply fails to consider the role of the target being modified.
Impact
Finding: a Company Owner can remove another Company Owner through the backend API and keep full control of the company.
Impact: a malicious or compromised Owner can remove another Owner, causing that person to lose administrative access while the attacker keeps control of the company's resources.
The other Owner's account still authenticates but is cut off from the company, potentially leaving the attacker as the only administrator.
Fix
The report does not describe a fix or a vendor response. Based on the root cause, the missing check is on the target: a member removal request should be refused when the member being removed holds the Owner role, unless the caller is specifically authorised to remove Owners, for example through an explicit ownership-transfer or owner-removal flow.
Variants to test
- Peer-role deletion in other multi-tenant products. Repeat the two-account setup in any product with an admin or owner tier and try removing the peer through the API. A positive result is a success response for the deletion, followed by the peer losing access while the caller keeps their role.
- Role change instead of removal. If the API exposes a role-update endpoint, try demoting a peer Owner to a lower role from an equal-privilege account. A positive result is the peer's privileges dropping while the caller's remain unchanged.
- Self-removal of the last Owner. Try removing yourself, or the only other Owner, and see whether the backend allows a company to be left without an administrator. A positive result is a company with no Owner left, or with the caller as the sole Owner after removing the peer.
- Identifier substitution. Change the
memberUidin the path, or thecompanyUidin the query string, to values belonging to another company you control. A positive result is the backend acting on the substituted identifier rather than validating that the member belongs to the company in the path. - Lower-privilege caller. Send the same deletion request from a Manager or User account against an Owner. A positive result is any response other than a permission error, which would show the requester-side check is weaker than assumed.
Glossary
- API: the fixed list of requests a server accepts, and the way programs ask it to do things, like a menu you order from instead of walking into the kitchen.
- Authentication: proving who you are, usually by logging in.
- Authorisation: deciding whether the person asking is allowed to do the thing they are asking for.
- Backend: the part of a website that runs on the company's server and makes the real decisions.
- Business-logic flaw: a bug where the software works as written but a rule the company intended was never enforced.
- Cookie / token: a small piece of text your browser keeps after login and sends with later requests, so the server recognises you, like a cloakroom ticket.
- DELETE: the HTTP method that asks a server to remove something.
- Frontend: the part of a website that runs in your browser, the part you see and click.
- GET: the HTTP method that asks a server to give you something.
- HTTP/2: a version of the protocol browsers and servers use to exchange requests and responses.
- Method: the verb of a request, such as
GETorDELETE. - Multi-tenant: a product where many separate companies or groups share the same system, each with its own members and data.
- 204 No Content: a success status meaning the server did what was asked and has nothing to send back.
- 403: a status meaning the server refused because you are not allowed.
- Owner: in this product, the top company role, with full access to the company.
- Path: the part of a request address that points at the thing being acted on.
- Query string: the part of an address after the question mark, carrying extra values such as identifiers.
- Request: one message a browser (or a tester) sends to a server.
- Role: a label attached to an account that decides what it may do.
- Session: the server's memory of your logged-in state, kept alive by a cookie or token.
- Status code: the short number in a server's reply, such as
204or403. - UID: a unique identifier for a record, such as a company or a member, so the server can tell them apart.