Security mailing lists by PureSourceCode

GO-2026-6278

MEDIUM

Gorilla WebSocket Uses Cryptographically Weak PRNG for WebSocket Mask Key

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

Published
24 Aug 2026
Last modified
23 Nov 2026
Weakness
CWE-338
Also known as
GHSA-w67g-5rqw-f597
Sources
OSV GHSA-w67g-5rqw-f597JSONOSVJSON

Scores

SourceScored byVersionScoreVector / decision
OSV GitHub CVSS 4.0 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

Affected

SourceVendor / ecosystemProduct / packageAffected versionsFixed in
OSV Go github.com/gorilla/websocket < 1.5.3 1.5.3
OSV Go github.com/gorilla/websocket < 1.5.1; >= 1.5.3, < 1.5.4-0.20240701034025-d67f41855da4 1.5.1, 1.5.4-0.20240701034025-d67f41855da4

References

History

  • 25 Nov 2026 20:14 UTC · OSV: first stored (published 25 Aug 2026)
  • 25 Nov 2026 20:14 UTC · OSV: first stored (published 24 Aug 2026)
An unhandled error has occurred. Reload ×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.