In-depth lesson · Cross-site WebSocket hijacking
Typical fixes
Every point the Cross-site WebSocket hijacking reports back under this heading, best-backed first, each with the reports it is seen in.
-
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
-
Validate the CSRF token before applying any state change and do not commit the update when the token is invalid.
-
Require the current password when creating or updating a security question and answer.
Seen in 1 report