WebSocket Wizardry: How a Forgotten Channel Let Me Sniff Private
A WebSocket endpoint accepted any token, including a dummy one, without server-side validation, and once connected it delivered all users' private chat messages in real time. An attacker could eavesdrop on internal conversations and potentially capture credentials.
Free Link 🎈
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
The WebSocket handshake trusted the authToken parameter without validating it server-side, and the token was not scoped to a user, so any connection received all chats.
Impact
An attacker could read all private chat messages in real time, potentially exposing credentials and personal data, and could automate the collection of many conversations.
What the attacker needed
Knowledge of the WebSocket endpoint URL; ability to send a WebSocket handshake request
How it was found
- Find the WebSocket URL in JavaScript files during reconnaissance.
- Replay the WebSocket handshake request manually with a dummy token.
- Observe that the connection succeeds without authentication.
- Receive live private chat messages from other users.
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 persistent two-way connection between a browser and a server, often used for live chat. The server here did not properly check who was connecting, so anyone who found the address could listen in on everyone else's private messages.
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.