Authorization Bypass Through User-Controlled Key Affecting @better-auth/stripe package, versions >=1.2.0-beta.18 <1.7.16>=1.8.0-beta.0 <1.8.0-beta.5


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.45% (41st percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Authorization Bypass Through User-Controlled Key vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-BETTERAUTHSTRIPE-23050777
  • published30 Nov 2026
  • disclosed21 Nov 2026
  • creditJakub Hrůza, iabdullah215, octane-security-team

Introduced: 21 Nov 2026

NewCVE-2026-134317  (opens in a new tab)
CWE-639  (opens in a new tab)

How to fix?

Upgrade @better-auth/stripe to version 1.7.16, 1.8.0-beta.5 or higher.

Overview

@better-auth/stripe is a Stripe plugin for Better Auth

Affected versions of this package are vulnerable to Authorization Bypass Through User-Controlled Key via the stripeCustomerId user field, which lacks input: false and therefore accepts values from sign-up and update-user requests. An authenticated user who knows another customer's Stripe customer ID can overwrite their own stripeCustomerId with that value, then open the billing portal for the victim customer to view invoices and billing details, change payment methods, and cancel or modify subscriptions. A subscription created for the victim customer outside checkout can also be attributed to the attacker. The flaw does not allow signing in as another user or expose Stripe API keys.

Note: Billing effects require subscription.enabled: true in the plugin configuration.

Workaround

Add databaseHooks.user.create.before and databaseHooks.user.update.before hooks that strip stripeCustomerId from incoming data. To detect values written before the fix, query for customer IDs held by more than one user record (e.g. on PostgreSQL: SELECT "stripeCustomerId", array_agg("id") AS user_ids FROM "user" WHERE "stripeCustomerId" IS NOT NULL GROUP BY "stripeCustomerId" HAVING count(*) > 1;). Run the same check on the organization table if organization billing is enabled.

References

CVSS Base Scores

version 4.0
version 3.1