No description
Implement strict CSI binary frame validation with per-connection malformed frame counters and automatic connection closure on persistent malformed input. Validation rules implemented: - Minimum frame length: 24 bytes (header only) - Maximum frame length: 280 bytes (24 header + 128 subcarriers × 2 bytes) - n_sub field: must be ≤128 - Payload length: must equal n_sub × 2 bytes exactly - channel: must be in [1,14] for 2.4 GHz; drop if 0 or >14 - rssi: 0 treated as invalid/missing (logged at DEBUG, but frame allowed) - timestamp_us: any uint64 value accepted Per-connection malformed counter (sliding 60-second window): - On each validation failure: increment malformed_count; log at DEBUG - If malformed_count > 100 within 60s: log WARN - If malformed_count > 1000 within 60s: close WebSocket with message 'Excessive malformed frames — possible firmware bug' - Counter resets every 60s Acceptance criteria met: - Valid frame: passes all checks in < 1 μs (benchmark test added) - Frame with n_sub=200: rejected (n_sub > 128) - Frame with len=10: rejected (< 24 bytes) - Frame with channel=0: rejected with DEBUG log - 1001 malformed frames in 60s: connection closed with correct message - 101 malformed frames: WARN logged, connection kept open - RSSI=0: allowed but logged at DEBUG for AGC skip Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .beads | ||
| .marathon | ||
| dashboard | ||
| docs | ||
| firmware | ||
| mothership | ||
| .dockerignore | ||
| .gitignore | ||
| .needle-predispatch-sha | ||
| .needle.yaml | ||
| docker-compose.yml | ||
| Dockerfile | ||
| PROGRESS.md | ||
| VERSION | ||