{"id":"GHSA-w67g-5rqw-f597","aliases":["GHSA-w67g-5rqw-f597","GO-2026-6278"],"related":[],"kind":"vulnerability","state":"published","title":"Gorilla WebSocket Uses Cryptographically Weak PRNG for WebSocket Mask Key","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.\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","summaryFormat":"markdown","summarySource":"ghsa","descriptions":[{"lang":"en","text":"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.\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","format":"markdown","source":"ghsa"},{"lang":"en","text":"Gorilla WebSocket Uses Cryptographically Weak PRNG for WebSocket Mask Key in github.com/gorilla/websocket","format":"markdown","source":"go"}],"published":"2026-08-24T21:00:54.000Z","modified":"2026-11-23T20:30:10.450Z","severity":{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N","rating":"MEDIUM"},"severities":[{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N","rating":"MEDIUM"}],"cwes":["CWE-338"],"affected":[{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.5.3"}],"ecosystem":"Go","package":"github.com/gorilla/websocket","purl":"pkg:golang/github.com/gorilla/websocket","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.5.1"},{"type":"semver","introduced":"1.5.3","status":"affected","fixed":"1.5.4-0.20240701034025-d67f41855da4"}],"ecosystem":"Go","package":"github.com/gorilla/websocket","purl":"pkg:golang/github.com/gorilla/websocket","source":"go"}],"references":[{"url":"https://github.com/canolgun-commits/websocket/security/advisories/GHSA-w67g-5rqw-f597","tags":["advisory","web"],"sources":["ghsa","go"]},{"url":"https://github.com/gorilla/websocket/commit/d67f41855da42d7bccd9ef050c49f7e54e783b95","tags":["fix","web"],"sources":["ghsa","go"]},{"url":"https://github.com/canolgun-commits/websocket","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/gorilla/websocket/releases/tag/v1.5.3","tags":["web"],"sources":["ghsa","go"]}],"credits":[],"sources":[{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-w67g-5rqw-f597","url":"https://github.com/advisories/GHSA-w67g-5rqw-f597","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:54.128Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-6278","url":"https://pkg.go.dev/vuln/GO-2026-6278","licence":"CC-BY-4.0","modified":"2026-11-23T20:30:10.450Z"}],"updatedAt":"2026-11-25T22:56:25.300Z"}