websocket-security
Skill18 starsChanged 3 months agoMITView on GitHub
Analyze WebSocket security posture — use when reviewing WS/WSS upgrade auth, origin checks, message authorization, or cross-site WebSocket hijacking risks (CWE-346 / CWE-352 / A01:2021).
7 other projects use a version of this.
Adopted by
Most recently taken up by
- conjure-3301/skillstheir own version, first seen Aug 17, 2026
- Kur1sulab/blackboxtheir own version, first seen Aug 12, 2026
- KaanBicaklar/mona-sast-skillstheir own version, first seen Jul 9, 2026
- ShieldNet-360/secure-vibetheir own version, first seen Jul 9, 2026
- jgamaraalv/delivery-looptheir own version, first seen Jul 4, 2026
- ShulkwiSEC/bb-hugetheir own version, first seen Jun 4, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- yaklang/hack-skills★ 2.4ksame name
- ShieldNet-360/secure-vibe★ 22same name
- ShulkwiSEC/bb-huge★ 22same name
- jgamaraalv/delivery-loop★ 4same name
- Kur1sulab/blackbox★ 3same name
- KaanBicaklar/mona-sast-skills★ 2same name
- conjure-3301/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository39 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- ai-agent-securitySkill
- ai-application-securitySkill
- api-securitySkill
- attack-surface-mappingSkill
- authentication-analysisSkill
- authorization-analysisSkill
- axguard-auditSkill
- axguard-csoSkill
- axguard-knowledgeSkill
- axguard-preshipSkill
- axguard-remediateSkill
- axguard-reportSkill
- axguard-securitySkill
- axguard-triageSkill
- cloud-securitySkill
- command-injectionSkill
- configuration-securitySkill
- deserialization-securitySkill
- file-upload-securitySkill
- graphql-securitySkill
- jwt-securitySkill
- mcp-securitySkill
- oauth-securitySkill
- path-traversalSkill
- prompt-injectionSkill
- prototype-pollutionSkill
- secrets-detectionSkill
- security-architecture-reviewSkill
- security-remediationSkill
- security-triageSkill
- session-securitySkill
- sql-injectionSkill
- ssrf-analysisSkill
- ssti-analysisSkill
- supply-chain-securitySkill
- threat-modelingSkill
- xss-analysisSkill
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 3 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 6 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 67
Verify Origin/Host allowlists — reject missing/unexpected Origin for cookie-auth sockets.
- Distinctive: line 68
Prefer explicit tokens over cookie-only WS when cross-site risk is high.
- Distinctive: line 84
No cookie auth and no sensitive commands
- Very specific: line 91
Use wss, short-lived tokens, and avoid putting long-lived secrets in query strings (logs).
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
WebSocket Security
Purpose
Guide defensive review of WebSocket endpoints: authentication at upgrade time, origin validation, per-message authorization, and abuse of long-lived channels.
When to Use / When Not to Use
Use when:
- Apps use
ws/wss, Socket.IO, Action Cable, Spring STOMP, or browserWebSocketto privileged backends. - Cookie sessions authenticate the upgrade (cross-site WebSocket hijacking risk).
- Real-time features push sensitive events or accept commands over WS.
Do not use when:
- Pure unidirectional server-sent events/HTTP without WS.
- Public read-only broadcast with no sensitive data and no command channel (still note DoS).
Security Concepts
The HTTP upgrade is the auth gate. Browsers send cookies on cross-site WS; Origin must be validated server-side. Authorization is not “once at connect” for every later message if topics/commands vary.
Threat Model
Attacker goals:
- Cross-site hijack of victim WS sessions to read/act.
- Subscribe to other users’ channels (BOLA over topics).
- Inject malicious messages causing XSS in listeners or server-side command execution.
- Resource exhaustion via connection floods / huge messages.
Analysis Workflow
- Locate upgrade handlers and auth checks (token query vs header vs cookie).
- Verify Origin/Host allowlists — reject missing/unexpected Origin for cookie-auth sockets.
- Prefer explicit tokens over cookie-only WS when cross-site risk is high.
- Map message types/topics; require authZ per subscribe/publish/action.
- Validate and size-limit message payloads; avoid
evalof message bodies. - Enforce TLS (
wss) in production; avoid sensitive data onws://. - Rate-limit connections and messages; idle timeouts.
Evidence Requirements
- Upgrade handler location and auth mechanism
- Missing Origin check or missing per-message authZ
- Sensitive event/command capability
- Impact (hijack / IDOR / injection / DoS)
False Positive Controls
- Token in protocol that is not auto-sent cross-site + Origin still checked
- No cookie auth and no sensitive commands
- Same-site-only deployments with hardened Origin allowlist and tests
Remediation
- Authenticate upgrade; re-authorize sensitive messages.
- Allowlist Origins; fail closed.
- Use
wss, short-lived tokens, and avoid putting long-lived secrets in query strings (logs). - Apply standard input validation to message payloads.
- Connection/message quotas and max payload sizes.
Verification
Review upgrade+message auth → Fix Origin/authZ → Re-test authorized clients only → Confirm cross-site connect fails closedRelated Skills
session-security,authentication-analysis,authorization-analysisapi-security,security-triage,security-remediation
Framework Mapping
- CWE-346 Origin Validation Error; CWE-352 CSRF
- OWASP A01:2021, A07:2021
- OWASP API2:2023, API5:2023
References
- https://owasp.org/Top10/A01_2021-Broken_Access_Control/
- https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures/
- https://cwe.mitre.org/data/definitions/346.html
- https://cwe.mitre.org/data/definitions/352.html
Research Provenance
Primary sources:
- OWASP A01/A07:2021; CWE-346; CWE-352; OWASP API2/API5:2023 (accessed 2026-09-15)
Secondary / internal:
- AXGuard
rules/auth.jsonadjacency;/axguard-auth - AwareXone Agentic-Bug-Hunter WebSocket methodology (concepts only; not copied)
Datasets:
- UVID HF dataset — category linkage concepts only (MIT license metadata review 2026-09-15)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

