Miggo Logo

CVE-2022-1996:
Authorization Bypass Through User-Controlled Key in go-restful

9.1

CVSS Score

Basic Information

EPSS Score
-
Published
6/9/2022
Updated
3/1/2023
KEV Status
No
Technology
TechnologyGo

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
github.com/emicklei/go-restful/v3go>= 3.0.0, < 3.8.03.8.0
github.com/emicklei/go-restfulgo< 2.16.02.16.0
github.com/emicklei/go-restful/v2go<= 2.7.1

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from improper origin validation in CORS handling. The isOriginAllowed function previously used regex patterns compiled by compileRegexps from AllowedDomains, allowing partial matches. The patched commit (fd3c327) replaces regex matching with exact string comparisons and removes compileRegexps, confirming these functions' role in the vulnerability. The CWE-639 description and commit message both indicate the root cause was insecure domain matching logic.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

*ut*oriz*tion *yp*ss T*rou** Us*r-*ontroll** K*y in *it*u* r*pository *mi*kl*i/*o-r*st*ul prior to v*.*.*.

Reasoning

T** vuln*r**ility st*ms *rom improp*r ori*in v*li**tion in *ORS **n*lin*. T** isOri*in*llow** *un*tion pr*viously us** r***x p*tt*rns *ompil** *y *ompil*R***xps *rom *llow***om*ins, *llowin* p*rti*l m*t***s. T** p*t**** *ommit (*******) r*pl***s r***