“Day 26: The WebSocket Hijack — How I Eavesdropped on Every Customer Support Chat”
The WebSocket chat authentication used a predictable session identifier passed in the first message, and an unauthenticated endpoint listed all active session IDs. An attacker could connect to any active support chat, read its full history and inject messages.
Published on infosecwriteups.com
The target was a major bank’s customer support portal. They had a sleek, modern live chat feature powered by WebSockets.
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 WebSocket backend treated a predictable, shared session identifier as proof of identity instead of authenticating the connection at the HTTP handshake, and a related endpoint exposed all active identifiers without authentication.
Impact
An attacker could read the full history of any active support chat, including sensitive account and personal details, and could send messages impersonating either the customer or the agent.
What the attacker needed
Network access to the chat portal; a valid or guessable chat session identifier
The fix
The connection should be authenticated during the HTTP handshake using the standard session cookie or a token, the upgrade rejected if invalid, and no second authentication message used afterwards.
How it was found
- Open browser developer tools, go to the Network tab and filter for WebSocket traffic.
- Observe the initial HTTP handshake that upgrades the connection to a WebSocket.
- Notice the first message after connecting carries an authentication token.
- Find in the JavaScript that the token comes from a REST endpoint when the chat starts.
- Write a script that connects and sends a guessed token to check whether it is accepted.
- Fetch the list of active sessions from an unauthenticated endpoint and connect to each one.
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.
A WebSocket is a two-way connection a website keeps open, often used for live chat. Here the server trusted a short, guessable code as proof of who you are, and another page handed out everyone's codes without asking for a login. So anyone who got a code could sit in someone else's chat.
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.