Websocket response manipulation leads to access admin panel
The application sent the user's role in a WebSocket login message, and the server trusted it. An attacker could change the role from visitor to admin and gain full administrative access without credentials.
medium.com
Published on medium.com
During a bug bounty hunting, I discovered a subdomain hosting a seemingly normal website. However, upon closer inspection, I noticed that the application supported multiple user roles with varying levels of access privileges.
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 server trusted a client-supplied role parameter in the WebSocket authentication message instead of deriving the role from the authenticated session.
Impact
An attacker could escalate from a standard visitor account to admin without any credentials, gaining full control over the application including user data and administrative actions.
What the attacker needed
A regular user account; ability to intercept WebSocket traffic
How it was found
- Capture the WebSocket login request and notice the role parameter set to visitor.
- Inspect the client-side JavaScript to find other possible role values.
- Set up a Burp Suite Match & Replace rule for WebSocket messages to change the role to admin.
- Log in with a regular user account and observe admin access.
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 you log in, the website tells the server who you are. Here, the website also told the server what role you have, like 'visitor' or 'admin'. The server believed it without checking. By changing that word to 'admin', the person could act as an administrator.
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.