Token Brute-Force to Account Take-over to Privilege Escalation to Organization Take-Over
The invitation system used a predictable numeric token that could be brute-forced, allowing an attacker to join an organisation without a valid invitation. Additionally, pending invitations and their roles were visible to any user, enabling privilege escalation to admin and ultimately organisation takeover.
{{media:0}}
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
The target was a product on redacted.com, tested through a private bug bounty program. The product is an application for viewing and managing all business data collected from several other apps in one place. Companies create a workspace or organisation inside the app, and an admin then invites users to join it. There are only two roles: user and admin.
The researcher notes that the data held in such a product is valuable, which is what makes the invite flow worth attacking.
Setup
The work was done against a private program, so the real hostnames are replaced with redacted.com throughout. No specific tools or versions are named. The researcher says testing the invite functionality is often a good place to start because it frequently produces critical issues.
Finding it
The invite flow initially looked solid. CSRF protection was in place and CORS was configured properly, so nothing obvious stood out. The first issue appeared when comparing two kinds of invitation.
When an admin invites an external user, the invitation link looks like this:
https://login.redacted.com/accounts/?service=product&digest=saaOBeXStZDRqgVlSRPAgPSY0
That link carries a digest value, which the researcher presents with a sarcastic "Pretty solid right?".
When the admin instead invites a user who already has an account on redacted.com, the resulting invitation is quite different:
https://product.redacted.com/invitations?inviteId=160000002637191&type=accept&source=mail
There is no signature and no hash on this second form, only an inviteId parameter alongside type=accept and source=mail. That is the discrepancy that made the flow worth digging into.

Exploitation
Step 1: Understand the structure of the invite ID
Further inspection showed that the inviteId is not opaque. In the example 160000002637191, the first 12 digits refer to the organisation and the last 3 are the invitation id. So 160000002637 is the organisation id and 191 is the invitation id. With only three digits of invitation id, the value is easily brute-forceable.
Step 2: Confirm the token does not expire on use by someone else
More tests showed a second weakness: the invitation does not expire if another person uses it. If the admin sends an invitation to email X, but an attacker brute-forces the token, the attacker can join the organisation with email Y, Z or N other emails, and the invite stays valid until email X is used. The admin continues to see the invitation as pending while the attacker is already inside.
The scenario the researcher summarises:
- Admin of the org sends an invitation to User A with email X.
- Attacker brute-forces the invitation ID.
- Attacker signs up with email Y.
- Attacker is inside the org.
- Admin still sees the invitation as pending.
Step 3: Use pending invitations to target an admin invite
The app had another issue: a user can view pending invitations and their roles. Once the attacker finds an admin invitation, he can exploit it and take over the whole organisation using the disclosed email address. This drastically reduces the brute-force effort: once a single valid token is found, the attacker stops brute-forcing and joins the organisation. If the invite was for an admin, that is the jackpot. If it was for a user, the attacker simply keeps checking the pending invites section until an admin invite appears. Given that an organisation can have a large number of users, there is a great chance the attacker remains unnoticed.
Root cause
The design flaw is that the invitation for an existing account is authorised by a predictable, unsigned identifier, unlike the external invitation link, which carries a digest value. The identifier is composed of a 12-digit organisation id and a 3-digit invitation id, so it can be enumerated. On top of that, the invitation is not invalidated when someone other than the intended recipient accepts it, and pending invitations, including their roles, are visible to ordinary users.
Impact
An attacker who can guess a valid invitation id can join an organisation without an invitation addressed to them, while the admin still sees the original invitation as pending. Because pending invitations and their roles are visible, the attacker can keep checking until an admin invitation appears and use it to take over the organisation. The researcher frames this as account take-over, privilege escalation and ultimately organisation take-over, and stresses that functional bugs like this can have critical business impact even when there is no technical vulnerability in the classic sense.
Fix
The report does not describe any fix or remediation that was applied. Based on the findings, the invitation for existing accounts should carry a signed, unpredictable token like the external invitation does, invitation ids should not be enumerable, an invitation should be invalidated once accepted by anyone, and pending invitations and their roles should not be exposed to ordinary users.
Variants to test
- Compare invitation links for external versus existing users on other products. A positive result is a signed parameter on one path and a bare sequential or structured id on the other.
- Decode structured identifiers such as
inviteIdinto organisation and invitation components. A positive result is a small, guessable range for the invitation part. - Accept an invitation with a different email from the one it was sent to. A positive result is joining the organisation while the original invitation remains pending.
- Check whether pending invitations and their roles are visible to non-admin users. A positive result is seeing an admin invitation that can then be accepted.
- Reuse an invitation after it has been accepted by someone else. A positive result is a second successful join with the same token.
What happened, in plain words
A security researcher was testing a private bug bounty program on a product hosted at redacted.com. The product is an application that lets a company view and manage all the business data it collects from several other apps in one place. Companies can create a workspace or organisation inside the app, and an admin can then invite users to join it. There are only two roles: user and admin.
The researcher found that the invitation system had a serious design flaw. When an admin invited someone who already had an account, the invitation link contained a simple number that could be guessed. By guessing that number, an attacker could join the organisation without an invitation. Worse, because users could see pending invitations and their roles, the attacker could wait for an admin invitation and use it to become an admin, and from there take over the whole organisation.
The researcher stresses that not all web vulnerabilities come from technical bugs. Functional bugs, meaning mistakes in how a feature is designed to work, can have critical business impact. This is the story of how chaining simple issues and poor design flaws led to account take-over, privilege escalation and ultimately organisation take-over.


The target and the setup
The researcher was working on a private program, so the real hostnames are replaced with redacted.com throughout. No specific tools or versions are named. The researcher often starts with testing the invite functionality because it frequently produces critical issues.
The product holds valuable business data, which makes it an attractive target. Companies create a workspace or organisation, and an admin invites users to join. There are only two roles: user and admin.
Finding the first issue
At first, the invite flow seemed solid. CSRF protection was in place and CORS was configured properly, so nothing obvious stood out. CSRF (Cross-Site Request Forgery) is an attack where a malicious site tricks a logged-in user's browser into sending a request to another site where the user is authenticated. CORS (Cross-Origin Resource Sharing) is a browser mechanism that controls whether a web page from one origin can read responses from another origin. Both were properly handled, so the researcher looked deeper.
The first issue appeared when comparing two kinds of invitation. When an admin invites an external user (someone who does not yet have an account), the invitation link looks like this:
https://login.redacted.com/accounts/?service=product&digest=saaOBeXStZDRqgVlSRPAgPSY0
This link carries a digest parameter, which is a long random-looking string. The researcher presents this link with a sarcastic "Pretty solid right?".
When the admin instead invites a user who already has an account on redacted.com, the resulting invitation is quite different:
https://product.redacted.com/invitations?inviteId=160000002637191&type=accept&source=mail
There is no signature and no hash on this second form, only an inviteId parameter alongside type=accept and source=mail. That is the discrepancy that made the flow worth digging into. The inviteId is a simple number, not a secret code.

Exploitation
Step 1: Understand the structure of the invite ID
Further inspection showed that the inviteId is not opaque. In the example 160000002637191, the first 12 digits refer to the organisation and the last 3 are the invitation id. So 160000002637 is the organisation id and 191 is the invitation id. With only three digits of invitation id, the value is easily brute-forceable. Brute-forcing means trying many possible values until you find the right one.
Step 2: Confirm the token does not expire on use by someone else
More tests showed a second weakness: the invitation does not expire if another person uses it. If the admin sends an invitation to email X, but an attacker brute-forces the token, the attacker can join the organisation with email Y, Z or N other emails, and the invite stays valid until email X is used. The admin continues to see the invitation as pending while the attacker is already inside.
The scenario the researcher summarises:
- Admin of the org sends an invitation to User A with email X.
- Attacker brute-forces the invitation ID.
- Attacker signs up with email Y.
- Attacker is inside the org.
- Admin still sees the invitation as pending.
Step 3: Use pending invitations to target an admin invite
The app had another issue: a user can view pending invitations and their roles. Once the attacker finds an admin invitation, he can exploit it and take over the whole organisation using the disclosed email address. This drastically reduces the brute-force effort: once a single valid token is found, the attacker stops brute-forcing and joins the organisation. If the invite was for an admin, that is the jackpot. If it was for a user, the attacker simply keeps checking the pending invites section until an admin invite appears. Given that an organisation can have a large number of users, there is a great chance the attacker remains unnoticed.
Root cause
The design flaw is that the invitation for an existing account is authorised by a predictable, unsigned identifier, unlike the external invitation link, which carries a digest value. The identifier is composed of a 12-digit organisation id and a 3-digit invitation id, so it can be enumerated. On top of that, the invitation is not invalidated when someone other than the intended recipient accepts it, and pending invitations, including their roles, are visible to ordinary users.
Impact
An attacker who can guess a valid invitation id can join an organisation without an invitation addressed to them, while the admin still sees the original invitation as pending. Because pending invitations and their roles are visible, the attacker can keep checking until an admin invitation appears and use it to take over the organisation. The researcher frames this as account take-over, privilege escalation and ultimately organisation take-over, and stresses that functional bugs like this can have critical business impact even when there is no technical vulnerability in the classic sense.
Fix
The report does not describe any fix or remediation that was applied. Based on the findings, the invitation for existing accounts should carry a signed, unpredictable token like the external invitation does, invitation ids should not be enumerable, an invitation should be invalidated once accepted by anyone, and pending invitations and their roles should not be exposed to ordinary users.
Variants to test
- Compare invitation links for external versus existing users on other products. A positive result is a signed parameter on one path and a bare sequential or structured id on the other.
- Decode structured identifiers such as
inviteIdinto organisation and invitation components. A positive result is a small, guessable range for the invitation part. - Accept an invitation with a different email from the one it was sent to. A positive result is joining the organisation while the original invitation remains pending.
- Check whether pending invitations and their roles are visible to non-admin users. A positive result is seeing an admin invitation that can then be accepted.
- Reuse an invitation after it has been accepted by someone else. A positive result is a second successful join with the same token.
Glossary
- API: Application Programming Interface; a set of rules that lets one piece of software talk to another. In web apps, it often refers to endpoints that return data in a structured format.
- Brute-force: Trying many possible values (like passwords or IDs) until the correct one is found.
- CSRF (Cross-Site Request Forgery): An attack that tricks a logged-in user's browser into sending an unwanted request to a site where the user is authenticated.
- CORS (Cross-Origin Resource Sharing): A browser security feature that controls whether a web page from one origin can read responses from another origin.
- Digest: In this context, a long random string used as a secret token to authorise an action.
- Endpoint: A specific URL or URI where an API or web service can be accessed.
- Enumeration: Systematically listing or guessing values, often by incrementing numbers or using patterns.
- Invite ID: The identifier for an invitation, in this case a number that encodes organisation and invitation information.
- Organisation ID: The identifier for an organisation within the app.
- Pending invitation: An invitation that has been sent but not yet accepted.
- Privilege escalation: Gaining higher access rights than originally granted, such as moving from a regular user to an admin.
- Role: A set of permissions assigned to a user, such as user or admin.
- Token: A piece of data used to authenticate or authorise an action, often a random string.
- Workspace: A shared environment within the app where a team manages data; similar to an organisation.