@better-auth/stripe is vulnerable to Insecure Direct Object Reference (IDOR) / Mass Assignment
59
CVE Score
Medium
Insecure Direct Object Reference (IDOR) / Mass Assignment
The Stripe plugin stores each user's Stripe customer ID (stripeCustomerId) on the user record, but the field was not marked as input: false, so the generic sign-up and update-user routes accepted it from the client. An authenticated user who knows another customer's Stripe ID can overwrite their own value with it, after which the billing portal, checkout and webhook handling treat that customer as theirs. The attacker can view invoices and billing details, change payment methods, and cancel or modify the victim's subscriptions, and subscriptions created outside checkout can be attributed to the attacker. The flaw does not allow signing in as another user or expose Stripe API keys.
Upgrade @better-auth/stripe to the patch version. The upgrade does not change values written before it, so check for Stripe customer IDs held by more than one user (and organization, if organization billing is enabled) and compare them with the Stripe customer's metadata.userId. As a workaround, add databaseHooks.user.create.before and databaseHooks.user.update.before hooks that remove stripeCustomerId from incoming data.
You are affected if you register the stripe() plugin from @better-auth/stripe and use a version within the vulnerable range. The billing effects require subscription.enabled: true.
1.2.0 - 1.7.15
Fixed in 1.7.16@better-auth/stripe is vulnerable to Insecure Direct Object Reference (IDOR) / Mass Assignment in versions 1.2.0 - 1.7.15.
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.