In-depth lesson · technique
Cross-site WebSocket hijacking
What every disclosed Cross-site WebSocket hijacking report in the index teaches, put together: how it works, how it changed year by year, where it turns up, and things to try. Every point shows the reports it is seen in.
- reports cited in this lesson
- 34
- median public bounty
- $1,050
Overview
What it is and why programs pay for it.
Cross-site WebSocket hijacking is a form of cross-site request forgery that targets WebSocket endpoints. It happens when a WebSocket server accepts connections from any origin and authenticates users only by their cookies. An attacker can then host a page that opens a WebSocket to the vulnerable server; the victim's browser sends the session cookie automatically, and the attacker's page can read and send messages as the victim. Bug bounty programs care because this flaw can expose sensitive data or allow actions on behalf of the user, often with minimal interaction.
The impact usually ranges from reading private information such as chat history, documents or session identifiers to performing state-changing actions like editing documents, changing settings or even taking over accounts. It is most often found in real-time features: chat applications, collaborative editors, login flows, notification streams and local services that expose WebSocket servers. Any endpoint that relies on cookies for authentication and does not check the Origin header is a candidate.
Seen in these reports9
-
$2,000 Critical -
Ability to perform various POST requests on quantopian.com as a different user - insecure by design.$1,050 Low -
$800 High
How it works
The mechanics, as the reports show them.
The attack begins when a victim visits a malicious page while logged into the target application. The page contains JavaScript that opens a WebSocket connection to the vulnerable endpoint. Because the browser includes cookies for the target domain with the handshake request, the server sees a valid session and accepts the connection.
The key enabler is the absence of Origin header validation. Browsers send an Origin header during the WebSocket handshake, but if the server does not check it, connections from any website are accepted. Many servers also rely solely on cookies for authentication and do not require a per-message CSRF token or other client context, so the attacker's page can send and receive messages freely.
Once connected, the attacker's page can read any data the server sends, such as chat messages, document contents or session tokens, and can send messages that trigger actions. The server treats these messages as coming from the authenticated user. This is possible because the WebSocket protocol does not enforce same-origin policy by itself; it is up to the server to validate the Origin and authenticate each connection properly.
Sometimes additional weaknesses make exploitation easier. For example, cookies set with SameSite=None are sent on cross-site requests, and permissive Origin checks using substring or regex matching can be bypassed with crafted origins. Local WebSocket servers that require no authentication and accept connections from any origin are also vulnerable, especially when they run on fixed ports.
Seen in these reports11
-
$800 High -
$30,000 -
$2,000 Critical
Year by year
4 yearsWhat each year's disclosed reports show, newest first. A year with few reports says less.
| 2015 | 1 |
|---|---|
| 2017 | 3 |
| 2018 | 1 |
| 2020 | 2 |
| 2021 | 1 |
| 2022 | 2 |
| 2023 | 1 |
| 2025 | 3 |
| 2026 | 4 |
-
2026
New this year2
- Hosting the malicious page on a subdomain of the same registrable domain so SameSite Strict or Lax cookies are still sent is a new pattern in the disclosed reports.
- Chaining self-XSS, cookie tossing and anti-CSRF token prediction to reach an auto-approval flow first appears in the disclosed reports.
Turned up less1
- The 2025 focus on local desktop WebSocket ports and client library handshake handling does not recur in the 2026 reports, which return to browser cookie and SameSite issues.
-
2025
New this year2
- SameSite bypasses are noted as part of the renewed cross-site WebSocket hijacking interest in the disclosed reports.
- Attacking a desktop terminal application's local WebSocket server on a fixed port first appears in the disclosed reports.
Kept working2
- Hunters recreated the browser's WebSocket connection with a generic client using the same URL pattern, headers, cookies and document identifier to test whether authentication was only cookie-based.
- Sending the client's initial READY or session-start message showed whether the server returned the full history or editor configuration.
-
2022
New this year1
- Chaining a crafted collaboration field update to a victim's build action is a new pattern in the disclosed reports.
Turned up less1
- The plain Origin-header swap against a login or chat socket, common in 2017, is not the focus of the 2022 reports, which instead target CSP and collaboration flows.
Reports from 20221
Earlier years1
Where it is found
20The features and places the reports found it in, most-reported first.
-
WebSocket endpoints used for login, documents, chat, collaboration and realtime editing.
Seen in 5 reports
-
Node.js socket.io and libcurl WebSocket handshake handling.
Seen in 1 report
-
A desktop terminal application running a local WebSocket server on a fixed port.
Seen in 1 report
-
A chat WebSocket that returns the full message history on a READY message.
Seen in 1 report
-
A self-hosted team chat product whose WebSockets do not check the Origin header.
Seen in 1 report
Technologies in these reports13
Root causes
18The mistakes in the code or configuration behind the reports.
-
The WebSocket server did not validate the Origin header during the handshake, so connections from any website were accepted and carried the victim's session.
Seen in 15 reports
-
The handshake authenticated only on cookies and required no per-message CSRF token or other client context.
-
The collaboration socket trusted client-supplied element selectors and values, and a build feature put a user-controlled value into the request URL without validation.
Seen in 1 report
-
The local WebSocket server required no authentication and accepted connections from any origin.
Seen in 1 report
-
Login, logout and OAuth connect endpoints lacked CSRF protection and profile fields allowed stored script.
Seen in 1 report
Things to try
The most-reported tests in the largest contexts. Tick what you have tried; ticks stay in this browser and carry over to the full checklist. Test only what a program's scope allows.
ticked in this lesson
Session cookies and SameSite behaviour
of 3 ticked-
Seen in 4 reports
-
Seen in 3 reports
WebSocket handshake and Origin validation
of 3 ticked-
Seen in 4 reports
-
Seen in 4 reports
Cloud shell and remote management endpoints
of 3 ticked-
Seen in 1 report
-
Seen in 1 report
Bypasses and variations
10How reports got past filters, encoders and other defences.
-
Host the malicious page on a subdomain of the same registrable domain so that SameSite Strict or Lax cookies are still sent.
Seen in 3 reports
-
Serve the malicious page from a same-site origin on a different port.
Seen in 1 report
-
Log the victim into the attacker's account first so the attacker's own stored XSS can read the victim's pages through same-origin frames.
Seen in 1 report
-
Use a crafted origin containing special characters to slip past a regex-based Origin check.
Seen in 1 report
-
Use an origin that the server parses as an allowed host but the browser treats as a different site.
Seen in 1 report
Payouts
5 paidPublic bounties in US dollars, from the data. 5 of 36 reports show an amount.
- a quarter paid up to
- $800
- median
- $1,050
- three quarters paid up to
- $2,000
- highest
- $30k
One in ten paid reports was paid $19k or more.
| Severity | Reports | Paid | Median | Highest |
|---|---|---|---|---|
| Critical | 1 | 1 | $2,000 | $2,000 |
| High | 3 | 1 | $800 | $800 |
| Medium | 3 | 0 | None paid | None |
| Low | 1 | 1 | $1,050 | $1,050 |
| Informational | 1 | 0 | None paid | None |
| Unrated | 27 | 2 | $15k | $30k |
Highest-paid reports5
-
$30,000 -
$2,000 Critical -
Ability to perform various POST requests on quantopian.com as a different user - insecure by design.$1,050 Low -
$800 High -
$40
Typical fixes
7How programs fixed it, as the reports describe.
-
Validate the Origin header on every WebSocket handshake and reject connections from unexpected origins.
Seen in 8 reports
-
Do not set authentication cookies with SameSite None; use a stricter attribute so cross-site connections do not carry the session.
Seen in 1 report
-
Do not issue WebSocket tokens or streams before user authentication, and do not hard-code tokens in client-side source.
Seen in 1 report
-
Authenticate and authorise connections to local debug adapter ports and do not accept HTTP framing as debug messages.
Seen in 1 report
-
Validate the Origin header on state-changing notebook requests and take the CSRF token only from a header or body field, not a request parameter.
Seen in 1 report
Tips for beginners
13Advice for a first hunt, drawn from the reports.
-
Test whether the server validates the Origin header. Capture the handshake request and resend it with the Origin changed to an external site. If the server still returns a successful upgrade (101 status), it is likely vulnerable.
Seen in 4 reports
-
Start by identifying WebSocket endpoints in the application. Look for features like live chat, notifications, collaborative editing, login flows and real-time updates. Use browser developer tools to capture the WebSocket handshake request and note the URL, headers and cookies.
Seen in 3 reports
-
Check if authentication relies solely on cookies. If you can connect from a foreign origin using the victim's cookies and receive data or perform actions, that confirms the issue. Use a generic WebSocket client to replay the handshake with the victim's cookies and observe the responses.
Seen in 3 reports
-
Look for sensitive data in WebSocket messages. Connect from a cross-site page and see if the server sends chat history, session identifiers, password reset tokens or other private information. This demonstrates impact beyond just establishing a connection.
Seen in 3 reports
-
Try to perform state-changing actions over the hijacked socket. Send messages that edit documents, change settings or invite users. If the server accepts them, you have a strong proof of concept.
Seen in 3 reports
Guides and techniques
The best explainers, cheat sheets and technique posts on Cross-site WebSocket hijacking, from around the web.
-
Hunting down subdomain takeover vulnerabilitiesExplains how to spot and confirm subdomain takeovers, automate detection and escalate them into token leaks, CSRF, CORS and CSP bypasses.
Methodology intigriti.com
-
That single GraphQL issue that you keep missingExplains how GraphQL endpoints can be vulnerable to CSRF when middleware accepts non JSON content types, despite common assumptions.
Technique blog.doyensec.com
-
"Iframe and window.open Magic" by huliHuli explains how iframe and window.open interactions can be abused, covering cross window scripting and related browser quirks.
Technique blog.huli.tw
-
The Modern CSRF Playbook: From Basic Mechanics to SameSite BypassesCovers CSRF mechanics and modern SameSite cookie bypass techniques, useful for hunters testing session protections.
Technique medium.com
-
15 Tools to Chain CORS, JSONP & XSS for Account Takeover: Master Your Pentesting GameLists tools for chaining CORS, JSONP and XSS flaws toward account takeover, useful but listy.
Technique medium.com
Keep learning
Where this lesson fits, and what to read next.
The whole class
How this is made: our model read every listed Cross-site WebSocket hijacking report in the index (our own summary where we have one, otherwise the title and the platform's label), listed the patterns, and merged them. Each point was kept only if the reports it cites exist, are listed and belong here; payouts are computed from the data, not written by the model. Read the originals before relying on a point. Generated 27 Nov 2026 from 39 reports. All Cross-site WebSocket hijacking reports.