@better-auth/oauth-provider is vulnerable to Privilege escalation
54
CVE Score
Medium
Privilege escalation
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.
Upgrade the @better-auth/oauth-provider library to the patch version.
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.
1.4.8 - 1.7.9
Fixed in 1.7.10@better-auth/oauth-provider is vulnerable to Privilege escalation in versions 1.4.8 - 1.7.9.
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.
I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.