/

CVE-2026-51584

Severity:

CRITICAL RISK

(9.8)

Improper Authentication (CWE-287) in usememos SSO Login

CVE-2026-51584

Deferred

Vulnerability type

Category:

Improper Authentication

CWE:

CWE-287

Impact:

Account Takeover

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A critical authentication flaw in usememos can allow a remote attacker to take over an account through the SSO sign-in flow. The risk arises when an attacker-controlled identity identifier is accepted without verifying it against the identity provider's stable subject claim.

Affected context

The issue occurs in the SSO credentials branch of the SignIn handler in usememos. Deployments are potentially affected when SSO identity matching relies on a user-controllable identifier rather than a provider-issued, stable subject value that is cryptographically or contextually bound to the authenticated identity.

Exploit preconditions

  • Attack surface: Remote SSO authentication endpoint
  • Required access: Ability to initiate or influence an SSO authentication flow
  • Trigger point: Identity lookup or account association in the SignIn handler
  • Why exploitation is possible: The application matches an SSO identity using an attacker-controllable identifier without validating the identity provider's stable subject claim

Why this happens

The underlying bug is an authentication-binding failure. The SSO implementation trusts an identity attribute that can be influenced by an attacker and uses it to associate the login with an existing account.

This maps to CWE-287: Improper Authentication, because the application does not sufficiently verify that the presented SSO identity corresponds to the intended identity-provider account. Authentication decisions should be based on stable, provider-validated subject identifiers rather than mutable profile fields or untrusted claims.

Potential impact

  • An attacker may gain access to another user's account
  • Attackers could access private application data and user content
  • Account-level administrative privileges may be exposed
  • Session abuse could enable further actions under the victim's identity
  • Organizational data confidentiality and integrity could be affected

General mitigation guidance

Mitigation typically focuses on strengthening the binding between the local account and the identity provider's authenticated subject.

Common defensive patterns include:

  • Use the IdP's stable, provider-validated subject claim as the account-linking key
  • Avoid using mutable usernames, email addresses, display names, or other attacker-influenceable attributes as sole identity keys
  • Validate issuer, audience, signature, nonce, and other protocol security properties before account association
  • Require explicit, authenticated confirmation for account linking or identity changes
  • Apply least privilege to SSO-linked accounts and administrative roles
  • Record and alert on unexpected identity-linking, subject changes, and anomalous sign-in activity

How teams detect issues like this

Organizations can assess for this class of issue through:

  • Static analysis and code review searches for account lookups based solely on mutable SSO claims
  • Review of SSO handlers for stable subject, issuer, audience, signature, and nonce validation
  • Tests using changed profile attributes while keeping the IdP subject constant, and vice versa
  • Policy checks requiring immutable provider-subject and issuer pairs for account association
  • Monitoring for unusual account-linking events, unexpected identity changes, and sign-ins from inconsistent IdP contexts

Automated security review tools may help identify authentication flows that trust user-controlled identity attributes.

Sources

SourceLink
gist.github.comgist.github.com/seiyaibuki0523/33a4c06eb7d10914e5e5152ecd5100ec
github.comgithub.com/usememos/memos

Frequently asked

questions

Yes. The affected SSO sign-in flow is remotely reachable, although successful exploitation depends on the deployment's identity-provider configuration and account-linking behavior.

Not necessarily. The key requirement is the ability to influence or present an SSO identity value that the application incorrectly trusts during account association.

Bind local accounts to the identity provider's stable subject claim together with the expected issuer, and reject account associations based only on mutable or attacker-controllable attributes.

Use established OIDC or SAML validation libraries, test identity-binding logic separately from profile mapping, require explicit confirmation for account linking, and monitor identity changes.

Find out what's already
exploitable in your codebase.