Field guide
WebSockets
The full-duplex door nobody guarded, because it is not HTTP.
Live chat, price tickers, notifications, and admin dashboards almost always talk over a WebSocket. Yet most teams test their REST endpoints carefully and forget the socket sitting right next to them, leaving old bugs wide open.
Think of a WebSocket like a phone call instead of a letter. HTTP takes turns: you send a request, wait for a reply, and hang up. A WebSocket starts with one quick HTTP greeting, then leaves the line open so both sides can talk at once. Every message after that greeting travels as a raw frame with no HTTP method, no URL path, and no headers.
The second server
Section titled “The second server”Engineering teams usually wrap their REST API in layers of defense: authorization middleware, a WAF, rate limits, and an API gateway. The WebSocket server sitting beside it often gets none of those guards. Because a socket has no neat list of REST routes, it slips past security reviews. Developers check the session once during the handshake, then trust every frame that arrives afterward.
The bugs hiding inside those frames are the same classics you already hunt: IDOR, broken access control, and injection. What makes them lucrative is how many tools look past them at the same time. HTTP proxies tuck frames into a separate tab, and WAF rules match HTTP requests instead of socket messages. Automated scanners rarely complete a handshake at all.
One question to keep in mind
Section titled “One question to keep in mind”When you test a REST API, you ask what the server checks on every request. When you test a WebSocket, ask what the server checked once during the handshake, and what every later frame gets away with unchecked.
How to use this guide
Section titled “How to use this guide”Read the chapters in order on your first pass, then keep the checklist open whenever you spot a live socket in scope. Always test with two accounts you own: Alice as the attacker and Bob as the victim. Stop as soon as a single frame proves the bug, and pull the matching fix from the defense chapter for your report.
Test only authorized targets and review the ethics and legal chapter before sending traffic. Start with Chapter 0 below to see exactly how the handshake turns into frames.
Open local graph around this page
WebSocketFor authorized testing only.