Miggo Logo

CVE-2025-50738: Memos has Cross-Site Scripting (XSS) Vulnerability in Image URLs

N/A

CVSS Score

Basic Information

EPSS Score
-
Published
7/29/2025
Updated
7/29/2025
KEV Status
No
Technology
TechnologyGo

Technical Details

CVSS Vector
-
Package NameEcosystemVulnerable VersionsFirst Patched Version
github.com/usememos/memosgo< 0.24.40.24.4

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability lies in the handling of user-uploaded files in the Memos application. An attacker could upload a file with a crafted content type (e.g., image/svg+xml) that contains malicious scripts. When another user's browser attempts to render this file, the script would execute, leading to a Cross-Site Scripting (XSS) attack. The provided commit patch addresses this issue in the GetResourceBinary function within server/router/api/v1/resource_service.go. The patch adds a check to identify potentially harmful content types and forces them to be served as application/octet-stream. This change ensures that browsers will treat the file as a downloadable binary rather than a renderable and potentially executable file, thus preventing the XSS attack. The vulnerable function is therefore APIV1Service.GetResourceBinary as it was the function responsible for serving the user-uploaded content without proper validation.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

T** M*mos *ppli**tion, up to v*rsion v*.**.*, *llows *or t** *m****in* o* m*rk*own im***s wit* *r*itr*ry URLs. W**n * us*r vi*ws * m*mo *ont*inin* su** *n im***, t**ir *rows*r *utom*ti**lly **t***s t** im*** URL wit*out *xpli*it us*r *ons*nt or int*r

Reasoning

T** vuln*r**ility li*s in t** **n*lin* o* us*r-uplo**** *il*s in t** M*mos *ppli**tion. *n *tt**k*r *oul* uplo** * *il* wit* * *r**t** *ont*nt typ* (*.*., `im***/sv*+xml`) t**t *ont*ins m*li*ious s*ripts. W**n *not**r us*r's *rows*r *tt*mpts to r*n**