Miggo Logo

CVE-2020-27813: Integer overflow in github.com/gorilla/websocket

7.5

CVSS Score
3.1

Basic Information

EPSS Score
0.39824%
Published
5/18/2021
Updated
11/4/2023
KEV Status
No
Technology
TechnologyGo

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
github.com/gorilla/websocketgo< 1.4.11.4.1

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot 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.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

*n int***r ov*r*low vuln*r**ility *xists wit* t** l*n*t* o* w**so*k*t *r*m*s r***iv** vi* * w**so*k*t *onn**tion. *n *tt**k*r woul* us* t*is *l*w to **us* * **ni*l o* s*rvi** *tt**k on *n *TTP S*rv*r *llowin* w**so*k*t *onn**tions.

Reasoning

T** vuln*r**ility st*ms *rom two k*y *r**s: *) In `**v*n***r*m*`, p*ylo** l*n*t* v*lu*s *rom *r*m*s (*sp**i*lly **/**-*it *xt*n*** l*n*t*s) w*r* *ir**tly *ssi*n** to `r***R*m*inin*` wit*out ov*r*low ****ks. T*is *llow** *tt**k*rs to s*t `r***R*m*inin