Skip to content

In-depth lesson · Cross-site WebSocket hijacking

Root causes

Every point the Cross-site WebSocket hijacking reports back under this heading, best-backed first, each with the reports it is seen in.

Back to the lesson 1 to 18 of 18
  1. 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
  2. The handshake authenticated only on cookies and required no per-message CSRF token or other client context.

    Seen in 2 reports
  3. 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
  4. The local WebSocket server required no authentication and accepted connections from any origin.

    Seen in 1 report
  5. Login, logout and OAuth connect endpoints lacked CSRF protection and profile fields allowed stored script.

    Seen in 1 report
  6. The site relied on SameSite=Strict alone to stop cross-site WebSocket hijacking without checking Origin, and a sibling subdomain had reflected XSS.

    Seen in 1 report
  7. The authentication cookie was set with SameSite None, so cross-site connections carried the victim's session.

    Seen in 1 report
  8. The WebSocket token and stream were generated before any user validation and the token was hard-coded in client-side source.

    Seen in 1 report
  9. The WebSocket endpoint relied solely on cookies for authentication.

    Seen in 1 report
  10. The debug adapter neither authenticated nor authorised connections to its local TCP port and parsed HTTP framing as valid debug messages.

    Seen in 1 report
  11. The SCM panel set authentication cookies to SameSite None and validated the Origin header with a regex that special characters could trick.

    Seen in 1 report
  12. The API over-relied on the SameSite cookie attribute, used weak substring content-type validation and made incorrect CORS assumptions.

    Seen in 1 report
  13. The notebook server did not validate the Origin header on state-changing requests and accepted the CSRF token from a request parameter.

    Seen in 1 report
  14. Origin header parsing was too permissive and treated a crafted origin as an allowed host.

    Seen in 1 report
  15. The handshake authenticated with a user identifier instead of a cookie, so knowing the identifier was enough.

    Seen in 1 report
  16. The endpoint that creates the security question and answer did not require the current password and was reused to update it.

    Seen in 1 report
  17. The server applied the state change before or regardless of validating the CSRF token, returning an error while still committing the update.

    Seen in 1 report
  18. User-controlled parameters were rendered as HTML without sanitisation.

    Seen in 1 report