One Pending Invitation Was Enough to Restore Revoked Admin Privileges
A pending invitation created by an administrator could still be accepted and grant Admin privileges after the inviter had been downgraded to Member. An attacker with a previously invited account could therefore obtain administrative control even though the original inviter no longer had that authority.
Cybersecurity
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
During a web application security assessment, I was testing a team management system that supports different roles and permission levels. Team owners could assign administrators, and administrators could invite new users and grant them roles. The feature under scrutiny was the invitation flow: an administrator creates an invitation for another account and assigns it a role, and the invited account accepts it later.
Everything appeared to work as expected. The interesting question was not whether a Member could perform an Admin-only action, but what happens to actions that were started before a role changed.
Setup
I used accounts under my own control:
- A team owner account.
- An administrator account, which I used to send the invitation.
- A second account, which received the invitation.
No special tooling is described beyond the application itself and a proof-of-concept video recording the complete scenario.
Finding it
While examining the authorization logic, I started asking a different question:
Does revoking a user's privileges also prevent previously initiated actions from granting those privileges later?
The invitation flow is a two-step operation: the inviter acts first, and the invited account completes the operation later. If the application checks the inviter's permissions only when the invitation is created, then a role change in between may not be reflected when the invitation is accepted.
Exploitation
Step 1: Invite an account as Admin
Using the administrator account, I invited another account and assigned it the Admin role. I left the invitation pending.
Step 2: Downgrade the inviter
I switched to the team owner's account and downgraded the original administrator to Member. At this point the original account no longer had administrative privileges, and it should no longer have had the authority to manage team permissions.
Step 3: Accept the pending invitation
I accepted the existing invitation using the second account. The invited account successfully obtained Admin privileges, even though the original inviter had already lost that role.
Step 4: Verify the new account's permissions
I then verified the new account's actual permissions. It could modify the roles of other team members, including the original administrator whose privileges the owner had revoked.
That was where the real security impact became clear.
Root cause
The core problem was that a previously issued invitation could still grant administrative privileges after the inviter's permissions had changed. The issue was not simply that an invitation link remained valid, or that pending invitations were not clearly displayed in the interface.
In authorization design terms, the question is whether the application checks permissions only when an operation is initiated, or also when it is completed.
Impact
Consider a team using the application to manage its members and resources. An administrator can invite additional accounts and assign them administrative privileges. Later, the owner decides that this administrator should no longer have that level of access and downgrades the account.
If previously issued invitations can still grant Admin privileges, revoking the original administrator's role may not fully prevent further administrative access. An account invited earlier could accept its pending invitation afterward and gain the ability to change other team members' permissions. In other words, the owner revoked the original administrator's authority, but the application still allowed an existing invitation to create a new path to administrative control.
The impact depends on an invitation having been issued before the downgrade and remaining pending until after it.
Fix
The report does not describe a fix or a vendor response. The design question it raises is whether permissions should be checked only when an operation is initiated, or also when that operation is completed. In this case, a pending operation had security consequences after the initiating user's privileges had been revoked.
Variants to test
- Invitation flows in other team products. Create an invitation as an admin, downgrade the inviter, then accept. A positive result is the invited account receiving the role assigned at invitation time.
- Role changes on the invited account. Change the role attached to a pending invitation, or the invited account's existing role, before acceptance. A positive result is the accepted role differing from what the current state should allow.
- Other two-step operations. Anything initiated by a privileged user and completed later, such as approval workflows, API key creation or scheduled exports. A positive result is the operation completing with the original privileges after the initiator has been downgraded.
- Removed inviters. Delete or deactivate the inviting account rather than downgrading it, then accept the invitation. A positive result is the invitation still granting its role.
- Revoked invitations. Revoke a pending invitation and attempt to accept it anyway. A positive result is the role being granted despite the revocation.
The takeaway: access control testing is not just about checking whether a Member can perform an Admin-only action. It is also about testing what happens when roles change, and whether previously initiated operations can still grant privileges that are no longer authorised. Sometimes the problem is not the permission itself, but when the application checks it.
What happened, in plain words
A team management system lets a team owner give other people different levels of power. The owner can make someone an administrator, and an administrator can invite new people and give them roles. I was testing this system and found a gap: if an administrator sends an invitation and is then demoted, the invitation still works. The person who accepts it gets the admin role that the now-demoted inviter had assigned, even though the inviter no longer has the right to give out that role. The new admin can then change other people's roles, including the role of the person who was demoted. So demoting someone does not fully take away their power if they had already sent an invitation.
This article walks through the whole test in beginner terms. You only need to know how to use a browser. I will explain each idea as it comes up.
The product and the feature
The application is a team management system. Think of it like a shared online workspace where a group of people manage members and resources. Each person has a role, which is a label that says what they are allowed to do. A team owner is the top role: they can assign administrators. An administrator is a middle role: they can invite new users and give them roles. A Member is a lower role with fewer powers.
An invitation is a message inside the app that offers someone a place on the team with a particular role. The inviter creates it, and the invited person accepts it later. That two-step nature is the heart of the issue: the inviter acts first, and the invited person finishes the action later.
Why I looked at this
Everything seemed to work as expected. Everything seemed to work as expected. But I asked a different question:
Does revoking a user's privileges also prevent previously initiated actions from granting those privileges later?
In everyday terms: if you take away someone's key to the office, does a door they already propped open stay open? The invitation is like that propped door. It was created while the inviter had the key, but it is used after the key is gone.
Setting up the test
I used accounts under my own control, so nothing affected real users:
- A team owner account.
- An administrator account, which I used to send the invitation.
- A second account, which received the invitation.
I did not use special tools beyond the application itself and a video recording of the whole scenario as proof.
Finding it
The invitation flow has two steps: the inviter acts first, and the invited account completes the operation later. If the application checks the inviter's permissions only when the invitation is created, then a role change in between may not be reflected when the invitation is accepted. That is the hypothesis I wanted to test.
Exploitation
Step 1: Invite an account as Admin
Using the administrator account, I invited another account and assigned it the Admin role. I left the invitation pending. A pending invitation is one that has been sent but not yet accepted. I left it pending on purpose: I wanted to see what would happen if the inviter's role changed before the invitation was used.
Step 2: Downgrade the inviter
I switched to the team owner's account and downgraded the original administrator to Member. Downgrading means changing someone's role to a lower one. At this point the original account no longer had administrative privileges, and it should no longer have had the authority to manage team permissions. The owner had taken away the key.
Step 3: Accept the pending invitation
I accepted the existing invitation using the second account. The invited account successfully obtained Admin privileges, even though the original inviter had already lost that role. This is the moment the gap showed: the invitation was created when the inviter was an Admin, and it still granted Admin after the inviter was demoted.
Step 4: Verify the new account's permissions
I then verified the new account's actual permissions. It could modify the roles of other team members, including the original administrator whose privileges the owner had revoked. That was where the real security impact became clear: the demoted person's invitation had created a new admin who could undo the owner's decision.
Root cause
The core problem was that a previously issued invitation could still grant administrative privileges after the inviter's permissions had changed. The issue was not simply that an invitation link remained valid, or that pending invitations were not clearly displayed in the interface. Those would be smaller problems. The real problem is about when the application checks permissions.
In authorization design terms, the question is whether the application checks permissions only when an operation is initiated, or also when it is completed.
A useful comparison is a bank transfer that needs approval. If the approver is fired after approving but before the money moves, should the transfer still go through? A careful system checks again at the moment of completion.
Impact
Consider a team using the application to manage its members and resources. An administrator can invite additional accounts and assign them administrative privileges. Later, the owner decides that this administrator should no longer have that level of access and downgrades the account.
If previously issued invitations can still grant Admin privileges, revoking the original administrator's role may not fully prevent further administrative access. An account invited earlier could accept its pending invitation afterward and gain the ability to change other team members' permissions. In other words, the owner revoked the original administrator's authority, but the application still allowed an existing invitation to create a new path to administrative control.
The impact depends on an invitation having been issued before the downgrade and remaining pending until after it. If no invitation is pending, this path does not exist.
Fix
The report does not describe a fix or a vendor response. The design question it raises is whether permissions should be checked only when an operation is initiated, or also when that operation is completed. In this case, a pending operation had security consequences after the initiating user's privileges had been revoked.
Variants to test
These are other situations where the same idea might appear. A variant is a related version of the same bug in a different place.
- Invitation flows in other team products. Create an invitation as an admin, downgrade the inviter, then accept. A positive result is the invited account receiving the role assigned at invitation time.
- Role changes on the invited account. Change the role attached to a pending invitation, or the invited account's existing role, before acceptance. A positive result is the accepted role differing from what the current state should allow.
- Other two-step operations. Anything initiated by a privileged user and completed later, such as approval workflows, API key creation or scheduled exports. A positive result is the operation completing with the original privileges after the initiator has been downgraded.
- Removed inviters. Delete or deactivate the inviting account rather than downgrading it, then accept the invitation. A positive result is the invitation still granting its role.
- Revoked invitations. Revoke a pending invitation and attempt to accept it anyway. A positive result is the role being granted despite the revocation.
The takeaway: access control testing is not just about checking whether a Member can perform an Admin-only action. It is also about testing what happens when roles change, and whether previously initiated operations can still grant privileges that are no longer authorised. Sometimes the problem is not the permission itself, but when the application checks it.
Glossary
- Role: a label that says what a user is allowed to do in an application.
- Team owner: the highest role in this team management system, able to assign administrators.
- Administrator: a role that can invite new users and grant them roles.
- Member: a lower role with fewer permissions.
- Invitation: a message in the app offering someone a place on the team with a particular role.
- Pending invitation: an invitation that has been sent but not yet accepted.
- Downgrade: changing a user's role to a lower one.
- Privilege: a permission to do something, such as managing team members.
- Revoke: to take away a privilege or permission.
- Authorization: the process of deciding whether a user is allowed to perform an action.
- Access control: the system of rules that decides who can do what.
- Two-step operation: an action where one person starts it and another person (or the same person later) completes it.
- Root cause: the underlying reason a bug exists.
- Impact: the real-world harm a bug can cause.
- Variant: a related version of the same bug in a different place or feature.
- Proof of concept (PoC): a demonstration that a bug is real, often a video or set of steps.
- API: a way for software to talk to other software; here, the application's own interface that the browser uses.
- Token: a piece of data that proves who you are, like a temporary key.
- Cookie: a small piece of data a website stores in your browser, often used to keep you logged in.