GHSA-w67g-5rqw-f597: Weak RNG

Published Aug 24, 2026
·
Updated

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

Affected Software

1 affected componentFixes available
go/github.com/gorilla/websocket<1.5.3
1.5.3

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade go/github.com/gorilla/websocket to a version that resolves this vulnerability.

    Fixed in 1.5.3
  2. Upgrade

    Upgrade gorilla/websocket to a version that resolves this vulnerability.

    Fixed in v1.5.3Patch d67f4185

Event History

Aug 24, 2026
Advisory Published
via GitHub·09:00 PM
Data Sourced
via GitHub·09:00 PM
DescriptionWeaknessAffected Software

Frequently Asked Questions

1

Which versions are affected and what version fixes the issue?

Versions prior to the commit d67f4185 are affected. The fix, which replaces math/rand with crypto/rand for WebSocket frame mask keys, was released in v1.5.3.

2

What conditions are required for exploitation?

An attacker must be able to predict or recover the deterministic math/rand output used for WebSocket frame mask keys. Predictable mask keys can enable injection of content into WebSocket connections.

3

What should teams do if they cannot immediately upgrade?

The provided data identifies upgrading to v1.5.3 or later as the available remediation. No temporary configuration workaround or mitigation is specified.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203