Advisory Database
  • Advisories
  • Dependency Scanning
  1. golang
  2. ›
  3. github.com/gorilla/websocket
  4. ›
  5. GHSA-w67g-5rqw-f597

GHSA-w67g-5rqw-f597: Gorilla WebSocket Uses Cryptographically Weak PRNG for WebSocket Mask Key

August 24, 2026

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

References

  • github.com/advisories/GHSA-w67g-5rqw-f597
  • github.com/canolgun-commits/websocket/security/advisories/GHSA-w67g-5rqw-f597
  • github.com/gorilla/websocket/commit/d67f41855da42d7bccd9ef050c49f7e54e783b95
  • github.com/gorilla/websocket/releases/tag/v1.5.3

Code Behaviors & Features

Detect and mitigate GHSA-w67g-5rqw-f597 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 1.5.3

Fixed versions

  • 1.5.3

Solution

Upgrade to version 1.5.3 or above.

Impact 6.5 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N

Learn more about CVSS

Weakness

  • CWE-338: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG)

Source file

go/github.com/gorilla/websocket/GHSA-w67g-5rqw-f597.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Tue, 08 Sep 2026 00:16:31 +0000.