Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
📦
📦 npm
Not in CISA KEV
MEDIUM severity

GHSA-p2fr-6hmx-4528 @better-auth/oauth-provid…

MEDIUM

GHSA-p2fr-6hmx-4528 is a medium-severity (CVSS 6.4) CWE-285 vulnerability in @better-auth/oauth-provider. A fix is available for @better-auth/oauth-provider — see the affected versions and patch details below.

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

Also known asCVE-2026-67332
Published
Jul 7, 2026
Updated
Sep 10, 2026
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Sep 21, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

No confirmed exploitation observed yet

  • CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.

Exploitation and automatability from CISA’s SSVC triage for GHSA-p2fr-6hmx-4528.

EPSS Exploitation Probability

via FIRST.org ↗
0.2%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs6th percentile — riskier than 6% of all scored CVEsHighest risk

EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.

How urgent is this, really

GHSA-p2fr-6hmx-4528 plotted by exploitation likelihood (EPSS) against impact (CVSS). The shaded corner — EPSS 50%+ and CVSS 7.0+ — is where this CVE doesn't sit, though severity or exploitability alone can still warrant action.

Where this sits among everything scored

Of 377,333 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Real counts from FIRST.org, not a sample — log-scaled since the landscape is heavily right-skewed.

Real-World Exposure

1 pkg affected

How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.

30other npm packages depend on this — each one inherits the vulnerability until it's patched upstream
@better-auth/oauth-providernpm
952Kdownloads / week

Description

Am I affected?

Users are affected if all of the following hold:

  • Their application depends on @better-auth/oauth-provider on any stable 1.6.x release (the stable line is not patched) or on a pre-release before 1.7.0-beta.4.
  • Their application either configures validAudienceswith more than one audience, or it issues JWT access tokens whoseaud`  (resource) claim is consumed by their resource servers.
  • Their resource servers make authorization decisions based on that aud or resource value.

A deployment with a single validAudiences entry (or the default, their server's base URL) cannot mint a token for a different audience. The provider rejects any resource outside the allowlist. Such a deployment still does not bind the resource to the authorization grant, so the spec-compliance gap remains even where cross-audience escalation does not apply.

Fix:

  1. Upgrade to @better-auth/[email protected] (then 1.7.0), then run the schema migration (npx auth migrate). This is a breaking change: a token or refresh request may only narrow the authorized resource, an uncovered resource returns invalid_target, and customAccessTokenClaims receives a resources array in place of resource.
  2. The 1.6.x stable line is not patched. If an application stays on it, developers should apply the workarounds below.

Summary

@better-auth/oauth-provider lets an OAuth client choose the access-token audience through the RFC 8707 resource parameter at the token endpoint. It does not bind that choice to the authorization grant. A client that completes a normal authorization flow can request a JWT access token whose audience targets a resource server the authorization never covered. The only constraint is that the resource appears in the server's validAudiences allowlist. The same gap applies to the refresh grant: a refresh token issued in a flow targeting one resource can be redeemed for an access token bound to a different allow-listed resource.

Details

The provider accepts resource only at the token endpoint, never at the authorization endpoint. At /oauth2/token it validates each requested resource against the server-wide validAudiences allowlist and writes the result into the JWT aud claim. It does not record the requested resources on the authorization code, and it does not store them on the refresh-token row.

Two consequences follow. For the authorization-code grant, the resource a client states at /oauth2/authorize is discarded, and the resource it sends at /oauth2/token is honored on its own, checked only against the allowlist. For the refresh grant, the audience is re-derived from the refresh request body alone, because no resource from the original grant is retained to constrain it. In both cases the audience becomes a per-request, client-chosen value rather than a property of the authorization.

This diverges from RFC 8707. The specification expects the authorization server to record the resources requested at authorization, then let the token endpoint narrow them but never widen them. A refresh token should stay bound to the resources of the original grant.

Patches

Fixed in @better-auth/[email protected] (then 1.7.0). The fix records the requested resources at authorization, stores them with the authorization code, enforces subset narrowing at the token endpoint, retains the original resource set across refresh, and exposes aud at introspection. The 1.6.x stable line is not patched.

The fix is a breaking change. It replaces customAccessTokenClaims.resource with a resources array, returns invalid_target for a resource the authorization did not cover, and adds a schema field that requires a migration. After upgrading, run npx auth migrate (or npx auth generate if developers manage the schema themselves).

Workarounds

If developers cannot upgrade their applications:

  • Set validAudiences to a single audience, or leave it unset so it defaults to their application's base URL. The provider then rejects any other requested resource, which removes cross-audience selection.
  • Configure each resource server to accept a token only when its own identifier is the expected audience, and to reject tokens whose aud is an array that also lists other audiences.
  • Do not rely on the resource indicator as an authorization boundary until developers run a release that contains the fix.

Impact

An attacker who can complete an OAuth flow for a registered client can obtain an access token whose audience points at a resource server that the user's authorization never covered. Where resource servers enforce the aud or resource value for authorization, a token granted for one resource becomes usable at another. The reachable data and operations stay limited to the scopes granted to that client, since the provider checks scopes independently of the resource.

Credit

Reported and fixed by @dvanmali.

Resources

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
📦npm@better-auth/oauth-provider1.4.8&&< 1.7.0-beta.41.7.0-beta.4npm install @better-auth/oauth-provider@1.7.0-beta.4

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for @better-auth/oauth-provider, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update @better-auth/oauth-provider to 1.7.0-beta.4 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-p2fr-6hmx-4528 is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like GHSA-p2fr-6hmx-4528 can be triaged on real exposure rather than presence alone.

Tailored to GHSA-p2fr-6hmx-4528. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

### Am I affected? Users are affected if all of the following hold: - Their application depends on `@better-auth/oauth-provider` on any stable `1.6.x` release (the stable line is not patched) or on a pre-release before `1.7.0-beta.4`. - Their application either configures validAudiences` with more than one audience, or it issues JWT access tokens whose `aud`  (resource) claim is consumed by their resource servers. - Their resource servers make authorization decisions based on that `aud` or resource value. A deployment with a single `validAudiences` entry (or the default, their server's bas
O3 Security · Impact-Aware SCA

Is GHSA-p2fr-6hmx-4528 in your dependencies?

O3 Security finds GHSA-p2fr-6hmx-4528 across npm dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.

GHSA-p2fr-6hmx-4528: Medium 6.4 severity | O3 Security