How I Found a Hidden Role in JavaScript That Became a Permanent Backdoor.
The application's JavaScript files referenced hidden roles SALES and PAYMENTS_AGENT that were not exposed in the UI. By appending a trailing space to the role value, a user with team management permissions could assign the SALES role, which granted full dashboard access and could not be revoked even by the Owner.
The application allows businesses to securely access users’ financial accounts and manage financial data.
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 API validated role names without trimming whitespace, so a role with a trailing space bypassed the check that blocked assigning the SALES role, and the system then treated it as the privileged role while also preventing its removal.
Impact
Any user with TeamManagement permission could escalate other members to the hidden SALES role, which grants full administrative capabilities and cannot be modified or revoked even by the Owner, creating a permanent privileged account and potentially enabling full team takeover.
What the attacker needed
Account with TeamManagement permission; ability to intercept and modify API requests
How it was found
- Inspect the application's JavaScript files to find references to undocumented roles SALES and PAYMENTS_AGENT.
- Using an account with invite and manage team members permission, intercept an invitation request and change the role to SALES; the API returns 400 Bad Request.
- Attempt to modify an existing member's role to SALES via the roles endpoint; the API returns 403 Forbidden with a message that the Sales role cannot be granted or revoked.
- Modify the role value by adding a trailing space (e.g., "SALES ") and send the request again; the API returns 204 No Content.
- Check the targeted user's permissions and observe they now include DashboardAccess, SendInvites, ManageRequests, TeamManagement, and SalesDemo.
- Try to remove or change the user's role from the team dashboard; attempts fail with an error saying the Sales role cannot be granted or revoked.
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.
The website had secret user roles that were not shown in the normal interface. A user with permission to manage team members could give someone a special role by adding a space to its name, and once given, that role could not be taken away, even by the team owner. This let a lower-level user gain permanent high-level access.
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.