cross site web socket hijacking
The WebSocket server accepted handshakes regardless of Origin, which may lead to cross-site WebSocket hijacking.
bb97a5545a1c33015200e2b Follow
Originally disclosed on HackerOne
- Disclosed after 7 days
In the below web-socket request successful 101 protocol handshake is working with the origin:https://app.legalrobot.com, but if you place the malicious origin in the place of https://thisdata.com which is http://evil.com or any page containing the malware, the web socket server is still giving 101 protocol successful handshake which means that we socket server is not checking origin headers while opening the connection which may lead to cross site web socket hijacking.
- Open https://app.legalrobot.com
- Intercept the websocket request with burpsuite like i've intercepted and send it to repeater
GET /sockjs/431/bcbqwec5/websocket HTTP/1.1 Host: app.legalrobot.com User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:55.0) Gecko/20100101 Firefox/55.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate, br Sec-WebSocket-Version: 13 Origin: https://app.legalrobot.com Sec-WebSocket-Extensions: permessage-deflate Sec-WebSocket-Key: jrJn6D4ddqaeGfrLMxQdow== Cookie: __cfduid=d3446c9cf6346287bf143c4d82a4843e81506572367; _ga=GA1.2.1754317931.1506572375; ajs_user_id=null; ajs_group_id=null; ajs_anonymous_id=%22d0db4012-5f13-4ef4-b25e-ea87340bddb9%22; intercom-id-nmyyq5i5=6ee58969-0370-4131-bae3-3f15c320ca9d; _gat=1; galaxy-sticky=!fqm5S7o42sAL2eD8T-zkg1n; _gid=GA1.2.930494122.1507113142 Connection: keep-alive, Upgrade Pragma: no-cache Cache-Control: no-cache Upgrade: websocket
- Now change the origin (from https://app.legalrobot.com) and replace it (to https://evil.com) with
maliious origin. 4. The web socket server is still giving successfull 101 handshake which means web socket server is not verifying the origin while opening the connection.
Both of the request i've attached below. Thank you.
Attachments


Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the WebSocket server did not validate the Origin header during the handshake, allowing connections from any website.
Impact
An attacker's website could open a WebSocket connection in a victim's browser and potentially read or send data on their behalf, though the report does not demonstrate actual data theft.
What the attacker needed
Malicious origin page
How it was found
- Open the application and intercept the WebSocket request.
- Send the intercepted request to Burp Repeater.
- Change the Origin header to a malicious site.
- Observe that the server still returns a successful 101 handshake.
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 report has not been written yet. The Original tab links to the source.
WebSockets let a website keep a two-way connection open with a server. Browsers send an Origin header to say which site is connecting, and servers should check it. Here the server did not check it, so another website could connect using the visitor's logged-in session.
What is CSRF?
Another site makes a signed-in user's browser perform an action they did not intend.