Auditing Websocket Connection Trust logo

Auditing Websocket Connection Trust

Organization
UnboundCompute
auditing-websocket-connection-trust

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.

Overview

PublisherUnboundCompute
Repositorysecurity-agent-skills
Skill nameauditing-websocket-connection-trust
Stars
27
Forks
8
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by UnboundCompute on GitHub. Read the source before you install it.

Installation

Install the Auditing Websocket Connection Trust AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/UnboundCompute/security-agent-skills/tree/main/skills/auditing-websocket-connection-trust
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/UnboundCompute/security-agent-skills.git /tmp/security-agent-skills
mkdir -p .claude/skills
cp -r /tmp/security-agent-skills/skills/auditing-websocket-connection-trust .claude/skills/auditing-websocket-connection-trust
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Auditing Websocket Connection Trust in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Auditing Websocket Connection Trust on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Auditing Websocket Connection Trust is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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't name the authorization, stop.

The loop

  1. Resolve the origin check and the credential source first. Determine how the handshake authenticates: an ambient session cookie sent automatically by the browser, or an unpredictable per-connection token (a ticket, a bearer in a subprotocol or query) that a cross-site page cannot read. Then determine whether the origin is validated on the upgrade, and where. Ambient credentials plus a missing origin check is the cross-site-hijacking precondition, so settle both before flagging.

  2. Check the origin gate on the upgrade. Look for a missing origin check, or an origin callback that returns true unconditionally, on a handshake that authenticates from an ambient cookie, letting an attacker's page open an authenticated socket and act as the victim.

  3. Check per-message authorization. Look for authentication established at the handshake with no authorization on individual messages, so a connection authenticated as a low-privilege user can send a privileged message the endpoint acts on without re-checking.

  4. Check the message-as-transport sink. Look for a message field flowing into a downstream injection sink (a query, a command, markup) where the socket is merely the transport; the second layer, not the socket, decides whether it is exploitable.

  5. Check denial of service and control tunneling. Look for an unbounded frame or message size or an unlimited connection allowance inviting resource exhaustion, for messages that tunnel past HTTP-layer controls that inspect only the upgrade request and not the frames, and for sensitive data broadcast to subscribers scoped more broadly than the data warrants.

  6. Confirm and record. Confirm by opening a socket from an attacker origin (for hijacking) or sending a privileged message on a low-privilege connection (for per-message escalation) and showing the action succeeds. Kill the lead if the origin is validated at the reverse proxy or ingress before the upgrade and the proxy actually rejects a non-allowlisted origin (verify the rejection, do not assume it), if the handshake requires a non-cookie unpredictable token a cross-site page cannot obtain, if a strict-or-lax same-site session cookie already blocks the cross-site handshake, if per-message authorization is enforced in a dispatcher rather than per handler, if the downstream injection sink is parameterized or escaped so the socket is only transport, or if the endpoint is unauthenticated public broadcast with nothing to steal. Record the endpoint, the trust checked only at the upgrade, and the action reached.

Where connection trust leaks

  • Ambient auth plus no origin check is cross-site hijacking. A cookie-authenticated handshake with no origin gate lets any page open the victim's socket; the origin, or a non-ambient token, is the defense.
  • A handshake is not a per-message gate. Authenticating once at the upgrade does not authorize each message; a privileged message on a low-privilege connection needs its own check.
  • A proxy origin check is a defense only if it rejects. Delegating the origin check to an ingress is fine only when the ingress actually denies a bad origin; confirm the backstop rather than assuming it.
  • The socket is often just transport. A message reaching a query or command sink is exploitable or not based on that downstream layer; parameterization there kills the finding.
  • Frames slip past request-only controls. A control that inspects the HTTP upgrade but not the frames is bypassed by the messages; and unbounded frames or connections are a denial-of-service allowance.

Worked example (a confirm and a kill)

Confirm. An upgrade handler sets its origin callback to always return true and authenticates the connection purely from the session cookie, with no per-connection token. An attacker's page opens a socket to the endpoint; the browser attaches the victim's cookie, the socket authenticates, and the page drives a privileged message. Confirmed cross-site WebSocket hijacking through a missing origin check on ambient-cookie authentication, high, remediation = validate the origin on the upgrade, require a non-ambient per-connection token, and authorize each privileged message.

Kill. The same endpoint requires a per-session ticket minted for a same-origin request and passed in the handshake, which a cross-site page cannot read, and the ingress rejects any non-allowlisted origin before the upgrade reaches the app. The cross-site page can neither carry the token nor pass the origin gate. Killed, kill_reason = "the handshake credential is not ambient and the origin is enforced and rejected upstream; the cross-site page cannot open an authenticated socket."

Rationalizations to reject

  • "We authenticate the connection." -> With an ambient cookie and no origin check? Then any page opens the victim's socket; the credential must be non-ambient or the origin must be enforced.
  • "The origin is checked at the proxy." -> Does the proxy actually reject a bad origin? Confirm the rejection; a delegated check that never denies is not a check.
  • "They authenticated at connect." -> Authenticated as whom, to do what? A privileged message needs its own authorization; the handshake does not cover it.
  • "The message goes to the database." -> Through a parameterized query? Then the socket is transport and the sink is safe; through string-built SQL it is injection at that layer.
  • "It is a public feed." -> Then hijacking steals nothing; but confirm no privileged message and no per-subscriber data crosses the same socket.

Executing this in practice

You need the upgrade handler and its origin check (and where it runs), the credential the handshake trusts and whether a cross-site page can obtain it, the per-message dispatch and any per-message authorization, the downstream sinks messages reach, the frame and connection limits, and the ingress origin policy and whether it rejects. For each privileged action, decide whether trust is re-checked past the upgrade. Reading the handshake tells you how trust is established; sending a message tells you whether it is re-checked.

Related

  • auditing-grpc-service-authorization - the sibling wire-protocol audit; there trust is assumed in an interceptor that misses a method, here trust is established once at the handshake and not re-checked.
  • auditing-cors-and-cross-origin-trust - owns the HTTP preflight and cross-origin-header semantics; a WebSocket deliberately sits outside that model (the server validates the origin itself), a genuinely different trust decision kept separate here.
  • auditing-session-lifecycle-and-fixation - owns cookie issuance and fixation; this skill owns whether an established connection re-checks trust per message, and the wss certificate check defers to the transport skill.
  • FINDING-SCHEMA.md - source = a cross-origin or unauthenticated handshake, sink = a privileged action reached over the socket, evidence = the missing origin or per-message check and the action driven.

Frequently asked questions

What does the Auditing Websocket Connection Trust AI skill do?

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,...

Why use Auditing Websocket Connection Trust on TypingMind?

Because you install it once and use it with any model. Auditing Websocket Connection Trust is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Auditing Websocket Connection Trust in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/UnboundCompute/security-agent-skills/tree/main/skills/auditing-websocket-connection-trust. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Auditing Websocket Connection Trust?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Auditing Websocket Connection Trust?

As many as you like. As long as a model supports skills, you can use Auditing Websocket Connection Trust with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Auditing Websocket Connection Trust AI skill free?

Yes. It is published on GitHub by UnboundCompute under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇