websocket
This skill should be used when the user asks to "check WebSocket security", "analyze WebSocket authentication", "find WebSocket vulnerabilities", "audit…
от florianbuetow★ 22 звезды на GitHub
Установить websocket в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
WebSocket Security (WS)
Analyze WebSocket implementations for security vulnerabilities including missing authentication on the upgrade handshake, no origin validation (Cross-Site WebSocket Hijacking), absence of message validation, missing rate limiting on messages, and use of unencrypted ws:// in production. WebSocket connections are long-lived and bidirectional, making them a persistent attack channel when not properly secured.
Supported Flags
Read ../../shared/schemas/flags.md for the full flag specification. This skill
supports all cross-cutting flags. Key flags for this skill:
--scopedetermines which files to analyze (default:changed)--depth standardreads code and checks WebSocket handlers and configuration--depth deeptraces message handling from connection through all event handlers--severityfilters output (WebSocket issues are oftenhighorcritical)
Framework Context
Key CWEs in scope:
- CWE-287: Improper Authentication (missing auth on upgrade)
- CWE-346: Origin Validation Error (CSWSH)
- CWE-20: Improper Input Validation (message validation)
- CWE-770: Allocation of Resources Without Limits (rate limiting)
- CWE-319: Cleartext Transmission of Sensitive Information (ws://)
Detection Patterns
Read references/detection-patterns.md for the full catalog of code patterns,
search heuristics, language-specific examples, and false positive guidance.
Workflow
1. Determine Scope
Parse flags and resolve the file list per ../../shared/schemas/flags.md.
Filter to files likely to contain WebSocket logic:
- WebSocket server setup (
**/ws/**,**/websocket/**,**/socket/**) - Socket.IO / ws configuration (
**/io.*,**/socket.*) - Message handlers (
**/handlers/**,**/events/**) - Middleware for upgrade requests (
**/middleware/**) - Client WebSocket code (
**/client/**,**/frontend/**)
2. Check for Available Scanners
Detect scanners per ../../shared/schemas/scanners.md:
semgrep-- primary scanner for WebSocket patterns
Record which scanners are available and which are missing. WebSocket-specific scanners are rare; most analysis relies on code review.
3. Run Scanners (If Available)
If semgrep is available, run with rules targeting WebSocket:
semgrep scan --config auto --json --quiet <target>
Filter results to rules matching WebSocket patterns. Normalize output to the findings schema.
4. Claude Code Analysis
Regardless of scanner availability, perform manual code analysis:
- Authentication on upgrade: Find WebSocket server creation and verify the upgrade/connection handler checks authentication (JWT, session cookie).
- Origin validation: Check whether the server validates the
Originheader during the WebSocket handshake to prevent CSWSH. - Message validation: Find message handlers and verify incoming messages are validated against a schema or type before processing.
- Rate limiting: Check for per-connection or per-message rate limiting to prevent message flooding.
- Transport security: Verify production configuration uses
wss://notws://for encrypted transport. - Authorization per message type: Verify sensitive operations sent via WebSocket check the user's permissions per action.
When --depth deep, additionally trace:
- Full message flow from receipt through handler to side effects
- Broadcast authorization (who receives which messages)
- Reconnection/resumption authentication
5. Report Findings
Format output per ../../shared/schemas/findings.md using the WS prefix
(e.g., WS-001, WS-002).
Include for each finding:
- Severity and confidence
- Exact file location with code snippet
- Attack scenario for the WebSocket vulnerability
- Concrete fix with diff when possible
- CWE references
What to Look For
These are the high-signal patterns specific to WebSocket security. Each maps
to a detection pattern in references/detection-patterns.md.
Missing authentication on upgrade -- WebSocket server accepts connections without verifying the client's identity during the HTTP upgrade handshake.
No origin validation (CSWSH) -- The server does not check the
Originheader, allowing malicious websites to open WebSocket connections to the server using the victim's cookies.No message validation -- Incoming WebSocket messages are parsed and processed without schema validation, enabling injection attacks.
No rate limiting -- No limit on message frequency, allowing a single client to flood the server with messages.
Unencrypted transport (ws://) -- Production WebSocket connections use
ws://instead ofwss://, exposing data in transit.
Scanner Integration
| Scanner | Coverage | Command |
|---|---|---|
| semgrep | WebSocket auth patterns, origin checks | semgrep scan --config auto --json --quiet <target> |
Fallback (no scanner): Use Grep with patterns fr
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- references/detection-patterns.md
FAQ
Что делает скилл websocket?
This skill should be used when the user asks to "check WebSocket security", "analyze WebSocket authentication", "find WebSocket vulnerabilities", "audit WebSocket handlers", "check for CSWSH", or mentions "WebSocket", "ws://", "wss://", "socket.io", "CSWSH", "WebSocket origin check", "WebSocket rate limit", or "WebSocket authentication" in a security context.
Как установить скилл websocket?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл websocket запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…