GHSA-4xr6-hc3h-f6jq: Unbounded allocation from peer-declared frame length in github.com/gobwas/ws
Published 2026-11-23 · Updated 2026-11-23 · Also known as GO-2026-6940
Summary
The github.com/gobwas/ws library is vulnerable to memory exhaustion caused by unbounded allocation during frame processing. Engineering teams using this library for WebSocket communication should update to version 1.5.0 to prevent remote denial-of-service attacks.
Who is affected
Applications using ws.ReadFrame, ws.MustReadFrame, or wsutil message readers are affected. A remote unauthenticated peer can cause an out-of-memory crash by sending a frame header that declares a large payload length, triggering an immediate buffer allocation.
Exploitability
Exploitability metrics including CVSS and EPSS are not documented for this vulnerability. It is currently not listed on the CISA Known Exploited Vulnerabilities catalog.
Remediation
- Upgrade github.com/gobwas/ws to version 1.5.0 or later.
How to check your project
- Check the go.mod file of your project to see if github.com/gobwas/ws is a dependency.
- Verify if the version of github.com/gobwas/ws currently in use is lower than 1.5.0.
Automated analysis of the published advisory data, generated 2026-11-23. Not human-reviewed; verify against the official advisory. How this works.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | Upgrade |
|---|---|---|---|---|
| Go | github.com/gobwas/ws |
>= 0, < 1.5.0 | 1.5.0 | go get github.com/gobwas/[email protected] |
FAQ
What is the root cause of this vulnerability?
The library allocates a memory buffer based on the payload length declared in the WebSocket frame header before actually reading any payload bytes, allowing for memory exhaustion.
Can this be exploited without authentication?
Yes, a remote unauthenticated peer can trigger the vulnerability by sending a malicious frame header.
Which specific components are affected?
The vulnerability exists in ws.ReadFrame, ws.MustReadFrame, and the message readers within the wsutil package.
Original advisory description
References
- ADVISORY https://github.com/gobwas/ws/security/advisories/GHSA-4xr6-hc3h-f6jq
- FIX https://github.com/gobwas/ws/commit/6b485812604c20a7174f3d68a64379121bcddfe2
- FIX https://github.com/gobwas/ws/pull/229
- REPORT https://github.com/gobwas/ws/issues/223
Source records: GO-2026-6940 (OSV.dev).