purpleworks / fleet-ui

Web based UI for fleet
http://fleetui.com/
MIT License
233 stars 39 forks source link

Fix Websocket hijacking vulnerability #34

Open wwwarrior opened 4 years ago

wwwarrior commented 4 years ago

WebSockets don't follow the Same-Origin Policy. This means that if the application relies on cookies (or Basic authentication) to perform authentication/authorization, a malicious website can get a victim to access this application via a WebSocket and potentially access/modify sensitive data as this user.

I created a Proof of Concept (malicious html-page) allowing read logs through this vulnerability.

More information about the vulnerability you can find here: https://portswigger.net/web-security/websockets/cross-site-websocket-hijacking

To prevent this issue, the Origin header check was added.