Intel

AIKIDO-2026-816450

@better-auth/oauth-provider is vulnerable to Privilege escalation

Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published Oct 16, 2026
October 16, 2026

54

CVE Score

Medium

Privilege escalation

Are you affected? Scan for Free

TL;DR

The OAuth authorize and consent endpoints call consentReferenceId and then look up oauthConsent with adapter.findOne. When that callback returns no reference, the query omits referenceId and matches any stored consent for the same client and user. An authorization can skip the consent prompt using another reference's scopes, and accepting consent overwrites that row's scopes. The fix looks up consent through findConsent, which matches referenceId exactly and treats a missing or empty value as only the consent stored without a reference.

How do I fix this?

Upgrade the @better-auth/oauth-provider library to the patch version.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and postLogin.consentReferenceId can return no reference while consent for the same client and user is also stored under an organization or other reference.

Versions

1.4.8 - 1.7.9

Fixed in 1.7.10

Background info

@better-auth/oauth-provider is vulnerable to Privilege escalation in versions 1.4.8 - 1.7.9.

Get secure today,
quickly and for free.

Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.

No credit card required | Scan results in 32 seconds.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea