<!-- Copyright (c) 2026 defconxt. All rights reserved. -->
<!-- Licensed under AGPL-3.0 — see LICENSE file for details. -->
<!-- NERF is a trademark of defconxt. -->
---
name: testing-websocket-security-flaws
description: >-
  Test WebSocket endpoints for cross-site hijacking, missing authentication on upgrade, message injection, and unauthorized subscription to sensitive data channels.
domain: cybersecurity
subdomain: bug-bounty
tags:
  - websocket
  - cswsh
  - ws-injection
  - authorization
version: "1.0"
author: defconxt
license: AGPL-3.0
metadata:
  mitre-attack: ["T1071.001"]
  frameworks: ["MITRE ATT&CK", "OWASP"]
  tools: ["burpsuite", "wscat", "zap"]
---

# Testing Websocket Security Flaws

## Overview

Test WebSocket endpoints for cross-site hijacking, missing authentication on upgrade, message injection, and unauthorized subscription to sensitive data channels.

## Prerequisites

| Tool / Requirement | Details |
|---|---|
| `burpsuite` | Security tooling |
| `wscat` | Security tooling |
| `zap` | Security tooling |
| Burp Suite, wscat, target WebSocket application | Environment requirement |

## Quick Reference

```bash
# Quick start commands
node scripts/agent.js --help
node scripts/agent.js test --url ws://target.com/ws --vector cswsh
```

## Workflow

### Step 1: Test Cross-Site WS Hijacking

```bash
node scripts/agent.js test --url ws://target.com/ws --vector cswsh
```

### Step 2: Fuzz Message Handlers

```bash
node scripts/agent.js fuzz --url ws://target.com/ws --wordlist ws_payloads.txt
```

### Step 3: Test Auth on Upgrade

```bash
node scripts/agent.js test --url ws://target.com/ws --vector no-auth
```


## Verification

- **Verify CSWSH test**: `node scripts/agent.js test --url ws://target.com/ws --vector cswsh`
- **Confirm message injection**: `node scripts/agent.js fuzz --url ws://target.com/ws --wordlist ws_payloads.txt`

## References

- MITRE ATT&CK: T1071.001
- Frameworks: MITRE ATT&CK, OWASP
- Tools: burpsuite, wscat, zap
