websocket-security

websocket-security is a skill for Claude Code, Codex from ShieldNet-360/secure-vibe. It costs 93 tokens per session (2,091 once invoked), scanned A, original, MIT.

A set of rules for securing WebSocket connections, which let a browser and server exchange messages over one long-lived connection.

In plain words
What is it for?
Use it when protecting WebSocket upgrades, browser authentication, message-level permissions, and limits on long-running connections.
Why use it?
It helps prevent another website from opening a connection with a user's cookies and ensures access is checked before the connection starts and while messages continue.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when protecting WebSocket upgrades, browser authentication, message-level permissions, and limits on long-running connections.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/shieldnet-360/secure-vibe/websocket-security
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ShieldNet-360/secure-vibe --skill websocket-security
Clone the repo
git clone --depth 1 https://github.com/ShieldNet-360/secure-vibe

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for websocket-security

README.md
[![agentmods](https://agentmods.dev/badge/skills/shieldnet-360/secure-vibe/websocket-security/github.svg)](https://agentmods.dev/skills/shieldnet-360/secure-vibe/websocket-security)
Your own site
<a href="https://agentmods.dev/skills/shieldnet-360/secure-vibe/websocket-security"><img src="https://agentmods.dev/badge/skills/shieldnet-360/secure-vibe/websocket-security/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for websocket-security

Your own site · 80×15
<a href="https://agentmods.dev/skills/shieldnet-360/secure-vibe/websocket-security"><img src="https://agentmods.dev/badge/skills/shieldnet-360/secure-vibe/websocket-security.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 93 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,091 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00093 $0.02091
Opus 5.5 $0.00037 $0.00836
Sonnet 5.5 $0.00019 $0.00418
Haiku 4.5 $0.00009 $0.00209

Measured 1mo ago against content hash 794809775be9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

websocket-security scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/websocket-security/SKILL.md · 140 lines

How it starts

The opening of the file, as written. The whole thing — 140 lines — stays where its author put it; the contents beside it link to each section on GitHub.

WebSocket Security

Rules (for AI agents)

ALWAYS

  • Validate the Origin header on the upgrade handshake against an allowlist, and understand precisely what that buys: the browser sets Origin and script cannot forge it, so the check stops Cross-Site WebSocket Hijacking — a page on attacker.com opening wss://api.example.com/ws and inheriting the user's cookies. It buys nothing against a non-browser client, which sets any header it likes. Origin is a CSRF control, not authentication. The same-origin policy and CORS preflight do not apply to the upgrade at all, which is why this check must be written by hand.
  • Authenticate the handshake, not the first frame. Once the upgrade completes the connection exists, has consumed the user's cookie context, and is already a resource the caller controls. A subscribe or auth message afterwards is too late.
  • For a browser client, pick one of two mechanisms, because the browser WebSocket constructor cannot set request headers — there is no Authorization header available to you:
    1. Cookie on the upgrade plus the Origin check above as the CSRF control, or
    2. A single-use ticket: the authenticated page calls an ordinary HTTP endpoint, receives a short-lived opaque ticket bound to the user and to the intended resource, passes it in the URL, and the server redeems and invalidates it at handshake time. A ticket is safe in a URL precisely because replaying it fails.
  • Re-authorize every frame, both the action and the subject it names. A frame like {"action":"write","subjectId":"X"} must be checked against the principal established at handshake — an authenticated socket must never be able to assert an arbitrary subject id per frame. That is per-frame BOLA, and the forged id reaches every consumer downstream of the socket that trusts it. Permissions also change while the connection is open: logout, role change, account lock, token expiry. A socket opened an hour ago carries an authorization decision an hour old.
  • Bound the connection: maximum frame and message size, messages per second per connection, concurrent connections per user and per source address, and total connection lifetime after which the client must re-handshake. A WebSocket is an allocation that persists, so every limit HTTP gets per-request must be re-expressed per-connection. Concrete starting values, and the backpressure and heartbeat settings, are in references/limits-and-handshake.md.
  • Use wss://. protocol-security owns the TLS configuration behind it; what belongs here is that ws:// exposes the session token, every frame, and the handshake itself to any on-path observer.
  • Consult auth-security for the token's own properties — lifetime, rotation, and why a bearer token does not belong in a URL — and cors-security for the origin allowlist itself, including how to treat the serialized null origin.

Read the full file on GitHub · 140 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 140 lines · 93 tokens per session scan A 794809775be9

Subscribe to this mod's changes

websocket-security is a skill published in the GitHub repository ShieldNet-360/secure-vibe (22 stars, last pushed 2mo ago), licensed MIT. It adds 93 tokens to every session and 2,091 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

offensive-api-abuse

Advanced API exploitation methodology focused on business logic abuse and sophisticated attack patterns that bypass traditional security controls. Covers business logic bypass through API call chaining and workflow manipulation. Addresses GraphQL-specific attacks including batching for credential brute-force, query…

SnailSploit/Claude-Red · 184 tokens

offensive-graphql

Offensive methodology for attacking GraphQL APIs during penetration tests and bug bounty engagements. Covers the full attack lifecycle: endpoint discovery, introspection abuse and blind schema reconstruction when introspection is disabled, authentication and authorization bypass through Relay node IDs and nested…

SnailSploit/Claude-Red · 219 tokens

agent-readiness-audit

Audit whether AI agents can actually use your product — docs, APIs, onboarding, errors, and discoverability, evaluated from a non-human user's perspective. Use when asked if a product is agent-ready, to audit a site or API for AI usability, to prepare for agentic traffic, or when agents keep failing against your…

mohitagw15856/pm-claude-skills · 117 tokens

api-docs-writer

Escribe documentación clara y orientada a desarrolladores. Úsalo cuando se te pida documentar un endpoint de API, escribir docs de referencia de API, crear una guía de desarrollador, o convertir una especificación cruda o colección Postman en documentación. Produce documentación de endpoint con descripciones…

mohitagw15856/pm-claude-skills · 80 tokens

api-security-best-practices

Implement secure API design patterns including authentication, authorization, input validation, rate limiting, and protection against common API vulnerabilities.

lingxling/awesome-skills-cn · 29 tokens

doku-payment-gateway

Expert guide for integrating DOKU Payment Gateway: DOKU Checkout (Hosted & Modal Popup with HMAC-SHA256), Direct API SNAP BI Standard (VA, QRIS, Direct Debit with HMAC-SHA512), and Direct API Non-SNAP (Card Payment Page, OVO Push). Covers single-integration checkout, direct host-to-host APIs, webhook verification, and…

roedyrustam/vibes-plug · 107 tokens