Miggo Logo

CVE-2022-4686: usememos/memos Authorization Bypass Through User-Controlled Key vulnerability

9.8

CVSS Score
3.1

Basic Information

EPSS Score
0.12804%
Published
12/23/2022
Updated
6/27/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:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
github.com/usememos/memosgo< 0.9.00.9.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from structs used in PATCH request handlers (MemoPatch, ResourcePatch, ShortcutPatch, UserPatch) having their ID fields exposed to user input via JSON deserialization. Prior to the patch, these structs lacked the json:"-" tag, allowing attackers to inject an ID parameter in requests. The associated handler functions (not explicitly named in the diff) would then process these user-controlled IDs without proper authorization checks, enabling resource modification bypass. The patch mitigates this by excluding the ID field from JSON parsing.

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 us*m*mos/m*mos prior to *.*.*.

Reasoning

T** vuln*r**ility st*ms *rom stru*ts us** in P*T** r*qu*st **n*l*rs (M*moP*t**, R*sour**P*t**, S*ort*utP*t**, Us*rP*t**) **vin* t**ir I* *i*l*s *xpos** to us*r input vi* JSON **s*ri*liz*tion. Prior to t** p*t**, t**s* stru*ts l**k** t** `json:"-"` t*