{"id":"GHSA-w67g-5rqw-f597","title":"Gorilla WebSocket Uses Cryptographically Weak PRNG for WebSocket Mask Key","summary":"Gorilla WebSocket Uses Cryptographically Weak PRNG for WebSocket Mask Key","severity":"medium","cwe":["CWE-338"],"vendor":"gorilla","product":"github.com/gorilla/websocket","ecosystem":"go","affected":["github.com/gorilla/websocket < 1.5.3"],"patched":["github.com/gorilla/websocket 1.5.3"],"published":"2026-08-24","updated":"2026-08-24","source":"GHSA","sourceUrl":"https://github.com/advisories/GHSA-w67g-5rqw-f597","references":[{"url":"https://github.com/canolgun-commits/websocket/security/advisories/GHSA-w67g-5rqw-f597"},{"url":"https://github.com/gorilla/websocket/commit/d67f41855da42d7bccd9ef050c49f7e54e783b95"},{"url":"https://github.com/gorilla/websocket/releases/tag/v1.5.3"},{"url":"https://github.com/advisories/GHSA-w67g-5rqw-f597"}],"tags":["ghsa","go"],"ingestedAt":"2026-08-24T21:11:25.037Z","slug":"GHSA-w67g-5rqw-f597","body":"## Overview\n\ngorilla/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.\n\n**Type:** Use of Cryptographically Weak Pseudo-Random Number Generator\n**Fix:** Replaced math/rand with crypto/rand (commit d67f4185, released in v1.5.3)\n**Credit:** bounty-hunter v6.0 silent-fix detection\n\n## Affected packages\n\n- `github.com/gorilla/websocket < 1.5.3`\n\n## Remediation\n\nUpgrade to a patched release:\n\n- `github.com/gorilla/websocket 1.5.3`","depth":"sunlit","depthScore":28,"depthScoreParts":{"impact":27.5,"likelihood":0,"exploitation":0,"ransomware":0},"changes":[]}