Gorilla WebSocket Uses Cryptographically Weak PRNG for WebSocket Mask Key
Key facts
- Attack vector
- —
- Privileges required
- —
- User interaction
- —
- Attack complexity
- —
- Impact type
- —
- Confidentiality · integrity · availability
- —
- Fix status
- Fixed
No CVSS vector from any source. Fix status from GitHub.
Summary
gorilla/websocket used `math/rand` (cryptographically weak pseudo-random number generator) to generate WebSocket frame mask keys prior to commit d67f4185. WebSocket masking keys MUST be unpredictable to prevent frame content injection attacks. math/rand produces deterministic output when seeded with a known value, enabling an attacker to predict or recover mask keys and inject content into WebSocket connections. **Type:** Use of Cryptographically Weak Pseudo-Random Number Generator **Fix:** Replaced math/rand with crypto/rand (commit d67f4185, released in v1.5.3) **Credit:** bounty-hunter v6.0 silent-fix detection
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | github.com/gorilla/websocket (Go) | before 1.5.3 | 1.5.3 | Patch available | GHSA-w67g-5rqw-f597 |
- github.com/gorilla/websocket (Go) Vendor— Affected before 1.5.3 Fixed in 1.5.3 Patch available GHSA-w67g-5rqw-f597
Remediation
- Fix · GHSA-w67g-5rqw-f597 github.com/gorilla/websocket (Go) Fixed in 1.5.3 Advisory →
Timeline
- 2026-10-03 Threatist record created from GHSA-w67g-5rqw-f597
References
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences