Summary
CVE-2026-51584 is a critical (CVSS 9.8) improper authentication vulnerability (CWE-287) in Memos (usememos), a self-hosted note-taking application. The flaw resides in the ssoCredentials branch of the SignIn handler, allowing a remote, unauthenticated attacker to take over any victim’s account via the SSO/OAuth2 login flow. It affects usememos v0.27.1 and earlier.
Technical details
- Root cause: the SignIn handler resolves local accounts using only the identity provider (IdP)-supplied identifier (e.g., username/email) as the lookup key, via a call resembling
GetUser(ctx, &store.FindUser{Username: &userInfo.Identifier}). - No linkage table binding
(user_id, idp_id, external_sub)exists — the stablesubclaim returned by the IdP is discarded, so the match relies entirely on an attacker-controllable field. - Attack vector: an attacker registers or configures an account on the trusted IdP with an identifier (username/email) matching a victim’s existing Memos account, then completes the standard OAuth2 login flow against the Memos instance.
- Impact: the SignIn handler resolves the login to the victim’s existing local account and issues a valid access token, giving the attacker full control of that account — network-based, no privileges or user interaction required.
Affected software
- usememos (Memos) versions up to and including v0.27.1, specifically the
SignInhandler inserver/router/api/v1/auth_service.go
Severity
- CVSS v3.1 Base Score: 9.8 (Critical)
- Vector:
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Mitigation and recommended actions
- Immediate: upgrade to Memos v0.28.0 or later, which introduces an external-identity linkage table with
(provider_uid, extern_uid)constraints and UUID-based username derivation, removing reliance on attacker-controllable identifiers. v0.30.0+ is recommended for additional provisioning hardening. - If immediate patching is not possible: disable or restrict SSO/OAuth2 login on internet-exposed Memos instances until upgraded, and audit existing accounts for suspicious SSO-linked sign-ins.

