← ClaudeAtlas

auditing-websocket-connection-trustlisted

Audit a WebSocket endpoint for trust established once at the handshake and never re-checked, so a cross-site page or a post-handshake message drives a privileged action, after the origin check and the credential source are resolved. Covers a missing or always-true origin check on the upgrade with ambient-cookie authentication, authentication at the handshake with no per-message authorization, a message treated as transport into a downstream injection sink, an unbounded frame or connection allowance inviting denial of service, tunneling past HTTP-layer controls that inspect only the request, and sensitive data broadcast to under-scoped subscribers. Use when reviewing the upgrade handler, the per-message dispatch, and the origin and credential checks, not the wss certificate validation the transport skill owns. A cross-origin or unauthenticated handshake is the source, a privileged action reached over the socket is the sink, and trust checked only at the upgrade is the bug.
UnboundCompute/security-agent-skills · ★ 27 · AI & Automation · score 80
Install: claude install-skill UnboundCompute/security-agent-skills
# Auditing WebSocket connection trust: trust checked once at the upgrade, never per message A WebSocket endpoint fails where it establishes trust once, at the upgrade, and never re-checks it. If the handshake authenticates purely from an ambient cookie and does not validate the origin, any web page can open an authenticated socket on the user's behalf (cross-site hijacking); if it authenticates at the handshake but never authorizes individual messages, a connection can escalate mid-stream. You audit it by resolving how the handshake authenticates (an ambient cookie, or an unpredictable token a cross-site page cannot read) and whether the origin is enforced, then following each privileged message to see whether it is re-authorized. A known false-positive trap lives here: an origin check delegated to a proxy is only a defense if the proxy actually rejects, so confirm the backstop. The wss certificate check belongs to the transport skill. ## When to use - You are reviewing a WebSocket upgrade handler, its origin check, and its per-message dispatch. - The endpoint authenticates at the handshake, from a cookie or a token, and then handles messages. - You want to know whether a cross-site page or a later message can drive a privileged action. ## Scope check Audit only endpoints you own or are authorized to assess, and open a socket or send a message only against a service in scope, a privileged message drives real state. Adjudicate on the handshake and the dispatch. If you can