{"id":"GHSA-w67g-5rqw-f597","aliases":["GO-2026-6278"],"status":"published","title":"Gorilla WebSocket Uses Cryptographically Weak PRNG for WebSocket Mask Key","description":"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","severity":{"version":"4.0","score":6.9,"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","level":"medium","from":"ghsa"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-338"],"published":"2026-08-24T21:00:54Z","modified":"2026-09-10T03:50:54Z","fixes":[{"ecosystem":"Go","package":"github.com/gorilla/websocket","fixed_in":["1.5.3"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"Go","package":"github.com/gorilla/websocket","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.5.3"}]}]},{"source":"osv","ecosystem":"Go","package":"github.com/gorilla/websocket","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.5.3"}]}]},{"source":"osv","ecosystem":"Go","package":"github.com/gorilla/websocket","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"1.5.3"}]}]}],"references":[{"url":"https://github.com/canolgun-commits/websocket/security/advisories/GHSA-w67g-5rqw-f597","tags":["web","advisory"]},{"url":"https://github.com/gorilla/websocket/commit/d67f41855da42d7bccd9ef050c49f7e54e783b95","tags":["web","fix"]},{"url":"https://github.com/gorilla/websocket/releases/tag/v1.5.3","tags":["web"]},{"url":"https://github.com/advisories/GHSA-w67g-5rqw-f597"},{"url":"https://github.com/canolgun-commits/websocket","tags":["package"]}],"sources":{"ghsa":[{"id":"GHSA-w67g-5rqw-f597","title":"Gorilla WebSocket Uses Cryptographically Weak PRNG for WebSocket Mask Key","description":"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","status":"published","published":"2026-08-24T21:00:54Z","modified":"2026-08-24T21:00:54Z","cvss":[{"version":"4.0","score":6.9,"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","level":"medium"}],"cwes":["CWE-338"],"updated_at":"2026-11-02T14:41:05.994358Z"}],"osv":[{"id":"GHSA-w67g-5rqw-f597","title":"Gorilla WebSocket Uses Cryptographically Weak PRNG for WebSocket Mask Key","description":"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","status":"published","published":"2026-08-24T21:00:54Z","modified":"2026-09-10T03:50:54.128553228Z","cvss":[{"version":"4.0","score":6.9,"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","level":"medium"}],"cwes":["CWE-338"],"updated_at":"2026-11-02T15:46:58.04805Z"},{"id":"GO-2026-6278","title":"Gorilla WebSocket Uses Cryptographically Weak PRNG for WebSocket Mask Key in github.com/gorilla/websocket","description":"Gorilla WebSocket Uses Cryptographically Weak PRNG for WebSocket Mask Key in github.com/gorilla/websocket","status":"published","published":"2026-08-25T15:00:08Z","modified":"2026-08-26T16:27:17.059721476Z","updated_at":"2026-11-02T15:47:03.11707Z"}]}}
