Skip to main content
VulnerabilityPublished

@better-auth/oauth-provider may provide access tokens for unauthorized audiences via unbound resource indicators

Affects @better-auth/oauth-providerSource GCVE Database

0

CVSS 6.4 Medium : upgrade to 1.7.0-beta.4 when convenient.

Data as of 8 Jul 2026, 13:45 UTC

CVSS 3.1 base score
6.4Medium
How severe the flaw is on the 0–10 CVSS scale.
Patch
Available – fixed in 1.7.0-beta.4
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N

What to do

Upgrade @better-auth/oauth-provider to 1.7.0-beta.4.

Affected software

ProductAffectedFixed in
npm@better-auth/oauth-providerAffected
  • >=1.4.8 <1.7.0-beta.4
Fixed in
  • 1.7.0-beta.4

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

A fix is available in @better-auth/oauth-provider version 1.7.0-beta.4 and later (including 1.7.0). Upgrading to these versions and running the required schema migration (e.g., via 'npx auth migrate') resolves the issue by binding resources to authorization grants and enforcing audience restrictions. The stable 1.6.x line is not patched. If upgrading is not possible, developers should limit 'validAudiences' to a single audience or the default base URL to prevent cross-audience token issuance. Additionally, resource servers should be configured to accept tokens only when the audience exactly matches their identifier and reject tokens with multiple audiences. If you cannot patch yet, do not rely on the resource indicator as a secure authorization boundary.

Description

The @better-auth/oauth-provider package versions in the stable 1.6.x line and pre-releases before 1.7.0-beta.4 allow OAuth clients to request access tokens for audiences (resources) that were not authorized during the initial authorization flow. This occurs because the provider does not bind the requested resource at the authorization endpoint to the token issuance, enabling clients to obtain tokens for any resource in the server's allowlist. The issue affects deployments that configure multiple valid audiences and rely on the audience claim for authorization decisions. The vulnerability is fixed in version 1.7.0-beta.4 and later, which enforce binding of resources to the authorization grant and restrict token issuance accordingly. Workarounds include limiting valid audiences to a single entry and configuring resource servers to reject tokens with unexpected audiences.

References

Community reviews

Loading reviews…