When Logic Meets Authentication — Orphaned Accounts to Full
An orphaned account tied to a deactivated organisation had an empty organisationId in the signup completion request, allowing the attacker to inject an active organisation ID and reach a hidden signup endpoint. This let the attacker create accounts with arbitrary emails and self-select a mentor or mentee role, bypassing the platform's invite-only and approval rules.
During a penetration testing of a mentoring platform, I uncovered a small edge case that let me bypass both authentication logic and business rules. By exploiting how the app handled orphaned accounts (users tied to deactivated orgs), I discovered a hidden signup request that let me:
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 backend failed to validate that the organisationId supplied in the signup completion request matched the inactive organisationId in the user's token, treating the mismatch as a valid signup flow.
Impact
An attacker could create new accounts with arbitrary emails and join any organisation as a mentor or mentee without an invite or approval, bypassing the platform's account creation rules.
What the attacker needed
Valid credentials for an orphaned account; knowledge of an active organisation ID
The fix
The backend should validate that the organisationId in the signup completion request matches the organisationId in the user's token, and reject mismatches or empty values for orphaned accounts.
How it was found
- Log in with an orphaned account (email and password) via the Google Identity Toolkit proxy.
- Exchange the returned ID token with the backend at the signup/complete endpoint, noting the empty organisationId.
- Replay the signup/complete request with a real active organisationId injected.
- The backend accepts the request and redirects to a hidden signup endpoint.
- Use the hidden signup endpoint to create a new account with an arbitrary email and password.
- During onboarding, choose the mentor or mentee role and land in the organisation.
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.
When a user's organisation is deactivated, the app still lets them log in but sends an empty organisation field to the server. The server trusts whatever organisation ID the client sends next, so an attacker can supply any active organisation and reach a hidden signup page. That page lets them create accounts without an invite and pick their own role.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.