CVE-2020-27813: Integer overflow in github.com/gorilla/websocket
7.5
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.39824%
CWE
Published
5/18/2021
Updated
11/4/2023
KEV Status
No
Technology
Go
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
github.com/gorilla/websocket | go | < 1.4.1 | 1.4.1 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from two key areas: 1) In advanceFrame
, payload length values from frames (especially 16/64-bit extended lengths) were directly assigned to readRemaining
without overflow checks. This allowed attackers to set readRemaining
to negative values via integer overflow, bypassing readLimit
. 2) The messageReader.Read
method modified readRemaining
without overflow guards, enabling infinite loops when processing maliciously fragmented frames. The patch introduced setReadRemaining
to validate()
values and prevent overflow, confirming these were the vulnerable paths.