@better-auth/oauth-provider@1.5.0-beta.16

An oauth provider plugin for Better Auth

  • latest version

    1.6.26

  • latest non vulnerable version

  • first published

    7 months ago

  • latest version published

    6 days ago

  • licenses detected

  • Direct Vulnerabilities

    Known vulnerabilities in the @better-auth/oauth-provider package. This does not include vulnerabilities belonging to this package’s dependencies.

    Fix vulnerabilities automatically

    Snyk's AI Trust Platform automatically finds the best upgrade path and integrates with your development workflows. Secure your code at zero cost.

    Fix for free
    VulnerabilityVulnerable Version
    • M
    Incorrect Authorization

    @better-auth/oauth-provider is an An oauth provider plugin for Better Auth

    Affected versions of this package are vulnerable to Incorrect Authorization due to the OAuth token and refresh flows in packages/oauth-provider/src/token.ts, packages/oauth-provider/src/authorize.ts, and packages/oauth-provider/src/consent.ts. An attacker can obtain an access token for an allow-listed audience that the authorization grant never covered by supplying a different resource value at the token endpoint, or widen a refresh token to another audience by redeeming it with a new resource value. This lets a client use a token at a resource server that the user did not authorize, causing unauthorized access to resource-specific APIs and data when those servers trust the token’s aud or resource claim.

    Workarounds

    • Set validAudiences to a single audience, or leave it unset so it defaults to your base URL; this prevents clients from choosing a different allow-listed resource at the token endpoint.
    • Configure each resource server to accept a token only when its own identifier is the expected aud, and reject tokens whose aud is an array that also lists other audiences; this limits use of tokens minted for multiple resources.
    • Do not rely on the resource indicator as an authorization boundary until you upgrade to a release that includes the fix; this avoids treating an unbound audience as proof of user authorization.

    How to fix Incorrect Authorization?

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

    >=1.4.8 <1.7.0-beta.4
    • M
    Incorrect Authorization

    @better-auth/oauth-provider is an An oauth provider plugin for Better Auth

    Affected versions of this package are vulnerable to Incorrect Authorization via the createOAuthClientEndpoint endpoint. An attacker can gain unauthorized access to register OAuth clients by bypassing the intended clientPrivileges authorization checks, allowing the creation of clients with attacker-controlled redirect URIs and metadata. This may lead to increased risk of phishing, social engineering, and abuse of trust in OAuth/OIDC flows.

    How to fix Incorrect Authorization?

    Upgrade @better-auth/oauth-provider to version 1.6.5, 1.7.0-beta.2 or higher.

    >=1.4.8-beta.7 <1.6.5>=1.7.0-beta.0 <1.7.0-beta.2