Vulnerabilities in pkg:golang/github.com/gorilla/websocket
PACKAGEGHSA-w67g-5rqw-f597 is a MODERATE gorilla websocket uses cryptographically weak vulnerability (CWE-338: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG)) affecting Github.com/gorilla/websocket libraries in the Go ecosystem. The issue involves gorilla websocket uses cryptographically weak prng for websocket mask key. Remediation is available by upgrading affected packages to version 1.5.3.
pkg:golang/github.com/gorilla/websocket
Vulnerability advisories affecting package pkg:golang/github.com/gorilla/websocket. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-w67g-5rqw-f597 | - | MODERATE | Gorilla WebSocket Uses Cryptographically Weak PRNG for WebSocket Mask Key |
| GHSA-3xh2-74w9-5vxm | CVE-2020-27813 | HIGH | Integer overflow in github.com/gorilla/websocket |
GHSA-w67g-5rqw-f597 at a Glance
How to Fix GHSA-w67g-5rqw-f597
To remediate this vulnerability, upgrade all affected Github.com/gorilla/websocket dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/gorilla/websocket to 1.5.3
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/gorilla/websocket
How to Check if You Are Affected
To determine whether your application is affected by GHSA-w67g-5rqw-f597, inspect your project dependencies for Github.com/gorilla/websocket:
inspect dependencies for github.com/gorilla/websocket
Analyze the terminal output to locate any version of Github.com/gorilla/websocket in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.5.3), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-338: Use of Cryptographically Weak Pseudo-Random Number Generator (PRNG), where the product uses a pseudo-random number generator (prng) in a security context, but the prng's algorithm is not cryptographically strong. In Github.com/gorilla/websocket, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-w67g-5rqw-f597 Affected Github.com/gorilla/websocket Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/gorilla/websocket
|
Go |
< 1.5.3
|
1.5.3
|
References
Frequently Asked Questions
What is GHSA-w67g-5rqw-f597?
Which Github.com/gorilla/websocket versions are affected?
What version fixes GHSA-w67g-5rqw-f597?
Is github.com/gorilla/websocket affected?
What CWE is associated with GHSA-w67g-5rqw-f597?
How can I check Go dependencies for GHSA-w67g-5rqw-f597?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-w67g-5rqw-f597",
"modified" : "2026-08-24T21:00:54Z",
"published" : "2026-08-24T21:00:54Z",
"aliases" : [ ],
"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.\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" : [ {
"type" : "CVSS_V4",
"score" : "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" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/gorilla/websocket"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.5.3"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/canolgun-commits/websocket/security/advisories/GHSA-w67g-5rqw-f597"
}, {
"type" : "WEB",
"url" : "https://github.com/gorilla/websocket/commit/d67f41855da42d7bccd9ef050c49f7e54e783b95"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/canolgun-commits/websocket"
}, {
"type" : "WEB",
"url" : "https://github.com/gorilla/websocket/releases/tag/v1.5.3"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-338" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-08-24T21:00:54Z",
"nvd_published_at" : null
}
}