[SEC-06] Missing Validation and Error Boundaries on WebRTC DataChannel Messages
- Dominant language
- Python
- Stars
- 0
- Forks
- 0
- Avg merge
- 2m
- Merged PRs (30d)
- 1
Description
## Problem Description
In `web/src/App.tsx` (`dc.onmessage`):
- `data.geohash.substring(0, 5)` assumes `data.geohash` is a string. If malformed/non-string JSON is sent, an unhandled `TypeError` crashes data processing on that channel.
- `data.graffitis` is iterated without type/array guards.
- Hex decoding in `fromHex` does not strictly validate even length / valid hex charset.
## Proposed Remediation
- Add strict type assertions and guards before accessing payload properties.
- Enhance `fromHex` helper with regex and even-length validation.
Contributor guide
No contributing guide indexed for this repository
Research direction
Read web/src/App.tsx at dc.onmessage and inspect the fromHex helper, starting with the current message shape and error handling. Done means malformed geohash or graffiti payloads and invalid hex are rejected without an unhandled channel error, while valid messages continue processing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend, security
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100