This skill handles real-time bidirectional communication with a heavy security focus on preventing Cross-Site WebSocket Hijacking (CSWSH). It covers origin header validation against explicit allowlists, token-based authentication (not cookies), and per-message authorization checks. You get TDD workflows for testing security boundaries first, plus performance patterns for connection pooling, message batching, and backpressure handling. The documentation is thorough on the attack surface, with concrete examples of validating origins, authenticating connections, and rate limiting. Useful if you're building anything with persistent WebSocket connections and need to avoid the common mistakes that lead to session hijacking or resource exhaustion.

skills.sh installs
269
GitHub stars
48
last updated
Aug 21, 2026

Install

$ npx -y skills add martinholovsky/claude-skills-generator --skill websocket --agent claude-code

Installs into .claude/skills of the current project.

Files

WebSocket Security Skill

File Organization

  • SKILL.md: Core principles, patterns, essential security (this file)
  • references/security-examples.md: CSWSH examples and authentication patterns
  • references/advanced-patterns.md: Connection management, scaling patterns
  • references/threat-model.md: Attack scenarios including CSWSH

Validation Gates

Gate 0.2: PASSED (5+ vulnerabilities documented) - CVE-2024-23898, CVE-2024-26135, CVE-2023-0957


1. Overview

Risk Level: HIGH

Justification: WebSocket connections bypass Same-Origin Policy protections, making them vulnerable to Cross-Site WebSocket Hijacking (CSWSH). Persistent connections require careful authentication, session management, and input validation.

You are an expert in WebSocket security, understanding the unique vulnerabilities of persistent bidirectional connections.

Core Expertise Areas

  • CSWSH (Cross-Site WebSocket Hijacking) prevention
  • Origin header validation and token-based authentication
  • Message validation and per-message authorization
  • Rate limiting and connection lifecycle security

2. Core Responsibilities

Fundamental Principles

Sponsors

Details

Repository
github.com/martinholovsky/claude-skills-generator
Categories
Backend & APIs, Security, Automation & Workflows
First seen
Jun 3, 2026

More from martinholovsky/claude-skills-generator

All 50
1thebushidocollective avatardjango-rest-frameworkthebushidocollective/hanUse when Django REST Framework for building APIs with serializers, viewsets, and authentication. Use when creating RESTful APIs.263skills.sh installs
2bobmatnyc avatarapi-security-reviewbobmatnyc/claude-mpm-skillsAPI security checklist for reviewing endpoints before deployment. Use when creating or modifying API routes to ensure proper authentication, authorization, and 257skills.sh installs
3davila7 avatarstring-databasedavila7/claude-code-templatesQuery STRING API for protein-protein interactions (59M proteins, 20B interactions). Network analysis, GO/KEGG enrichment, interaction discovery, 5000+ species, 255skills.sh installs
4davila7 avatarclinvar-databasedavila7/claude-code-templatesQuery NCBI ClinVar for variant clinical significance. Search by gene/position, interpret pathogenicity classifications, access via E-utilities API or FTP, annot254skills.sh installs
5cloudai-x avatarconvex-backendcloudai-x/claude-workflow-v2Convex backend development guidelines. Use when writing Convex functions, schemas, queries, mutations, actions, or any backend code in a Convex project. Trigger240skills.sh installs
6davila7 avatarbrenda-databasedavila7/claude-code-templatesAccess BRENDA enzyme database via SOAP API. Retrieve kinetic parameters (Km, kcat), reaction equations, organism data, and substrate-specific enzyme information222skills.sh installs