Logo di Auditing Websocket Connection Trust

Auditing Websocket Connection Trust

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

Panoramica

Pubblicato daUnboundCompute
Repositorysecurity-agent-skills
Nome della skillauditing-websocket-connection-trust
Stelle
27
Fork
8
File inclusi
Solo istruzioni
LicenzaMIT
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • Tutto nelle istruzioni

    Tutto ciò che serve al modello è nelle istruzioni: nessun file aggiuntivo da sincronizzare.

  • Open source

    Pubblicata da UnboundCompute su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Auditing Websocket Connection Trust in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/UnboundCompute/security-agent-skills/tree/main/skills/auditing-websocket-connection-trust
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'agente.

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
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Auditing Websocket Connection Trust in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Auditing Websocket Connection Trust non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Auditing Websocket Connection Trust non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

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.

Domande frequenti

Cosa fa la skill IA 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,...

Perché usare Auditing Websocket Connection Trust su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Auditing Websocket Connection Trust è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Auditing Websocket Connection Trust in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/UnboundCompute/security-agent-skills/tree/main/skills/auditing-websocket-connection-trust. TypingMind legge il file SKILL.md e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Auditing Websocket Connection Trust?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Auditing Websocket Connection Trust?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Auditing Websocket Connection Trust: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Auditing Websocket Connection Trust è gratuita?

Sì. È pubblicata su GitHub da UnboundCompute con licenza MIT. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇