Cryptographic Weakness in Gorilla WebSocket Package: Vulnerability Overview

github.com/gorilla/websocket Updated 26 Aug 2026

Summary

25/08/2026
N/A
Yes i
Unrated
Not published

GO-2026-6278: Gorilla WebSocket Uses Cryptographically Weak PRNG for WebSocket Mask Key in github.com/gorilla/websocket. Affects github.com/gorilla/websocket versions < 1.5.3. Fixed in 1.5.3. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

The Gorilla WebSocket package is a widely used library in the Go programming language that facilitates the implementation of WebSocket connections. It provides features such as connection management, message handling, and support for various subprotocols. The package is known for its ease of use and robust performance, making it a popular choice for developers building real-time applications. However, it has been identified that the package employs a cryptographically weak pseudo-random number generator (PRNG) for generating WebSocket mask keys, which can expose applications to security risks.

Vulnerability Detail

The vulnerability arises from the use of a weak PRNG in the Gorilla WebSocket package for generating mask keys. This weakness can allow attackers to predict the mask keys used in WebSocket communications, potentially leading to unauthorized access or manipulation of data being transmitted over the WebSocket connection. The issue is particularly critical as it can compromise the integrity and confidentiality of real-time data exchanges, making it a significant security concern for applications relying on this library.

How To Fix

Latest published version: v1.5.3 as of 23 Oct 2026

go get github.com/gorilla/websocket@v1.5.3

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.5.3

This is the first release that contains the fix.

go get github.com/gorilla/websocket@v1.5.3

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, developers can implement their own secure PRNG for generating mask keys in their WebSocket implementations. However, this approach requires careful consideration to ensure that the custom implementation is secure and does not introduce additional vulnerabilities.

Conclusion

The Gorilla WebSocket package has a critical vulnerability due to the use of a weak PRNG for generating mask keys. It is essential for developers using this package to update to the patched version to mitigate security risks. Additionally, utilizing tools like Vulert can help monitor and alert for such vulnerabilities in real-time.

See every vulnerability recorded for github.com/gorilla/websocket →

Share this vulnerability

FAQ

The Gorilla WebSocket package is a library in Go that simplifies the creation and management of WebSocket connections, allowing for real-time communication in applications.

The vulnerability involves the use of a weak PRNG for generating mask keys, which can lead to predictable keys and potential security breaches in WebSocket communications.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

The risks include unauthorized access to WebSocket communications, data manipulation, and potential exposure of sensitive information.

Yes, the vulnerability has been patched in version 1.5.3 of the Gorilla WebSocket package. It is recommended to update to this version or later.

Related vulnerabilities

Recent vulnerabilities recorded for github.com/gorilla/websocket.

How To Fix

Latest published version: v1.5.3 as of 23 Oct 2026

go get github.com/gorilla/websocket@v1.5.3

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.5.3

This is the first release that contains the fix.

go get github.com/gorilla/websocket@v1.5.3

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback