Advisory

GHSA-w67g-5rqw-f597

Also known as: GO-2026-6278

Summary

Gorilla WebSocket Uses Cryptographically Weak PRNG for WebSocket Mask Key

Details

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

Severity

Medium Basis: The source's own band: MODERATE

Dates

Published
2026-08-24 21:00 UTC
Modified
2026-09-10 03:50 UTC

Affected packages and fixes

github.com/gorilla/websocket

Go · All systems

Affected

  • introduced 0, fixed 1.5.3 (semver)

Fixed versions

1.5.3

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences