Summary
@better-auth/stripe: cross-organization billing tampering in organization subscription actions
Am I affected?
You are affected if all of these are true:
- You use
@better-auth/stripefrom version 1.4.11 up to a patched version below. This covers the stable line through 1.6.20 and every 1.7.0 beta through 1.7.0-beta.9. - The Stripe plugin has subscriptions turned on (
subscription.enabled: true). - Organization subscriptions are turned on (
organization.enabled: true) and you have set anauthorizeReferencecallback. - A user can join more than one org. So a user can be a member of an org whose billing they should not manage.
You are not affected if you only use user subscriptions. You are also not affected if org subscriptions are turned off.
An org subscription action can run against the wrong org. The actions are cancel, change plan, restore, and open the billing portal. The plugin checks permission against the org id in the request query string. It then runs the action against the caller's active org from their session. When these two ids differ, a member can act on billing for an org they may not manage. The target is always an org the caller belongs to.
Details
The plugin runs two steps for each org subscription action. First, a middleware decides if the caller may use the requested org. It reads the org id from the request body or the query string. It then passes that id to your authorizeReference callback. Second, the route handler runs the action. The handler reads the org id from the request body only. It falls back to the active org in the session when the body has no id.
The gap is the query string. A caller puts an org they may manage in the query string. The middleware approves that org. The handler ignores the query string. It finds no id in the body, so it acts on the caller's active org instead. The check and the action no longer agree.
Workarounds
If you cannot upgrade, make authorizeReference approve only the caller's active org. Return false when the requested id is not the active org id. Keep your existing role check too:
if (referenceId !== session.activeOrganizationId) {
return false;
}
This forces the approved org and the active org to be the same value.
Credit
Reported and fixed by Taesu (@bytaesu).
Impact
- A signed-in member can make a subscription action run against the wrong org. The action can be cancel, change plan, restore, or billing portal. The target is limited to orgs the member belongs to.
- Through the billing portal, a member can reach another org's billing details. This includes payment methods, invoices, and subscription state.
The application does not correctly enforce access controls, allowing a principal to access resources or operations beyond their granted permissions. Typical impact: unauthorized data access or execution of privileged operations.
GHSA-H3RM-78G3-J7CP has a CVSS score of 7.1 (High). The vector is network-reachable, low privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (1.6.21, 1.7.0-beta.10); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
Upgrade to one of these patched versions:
- Stable:
@better-auth/[email protected]or later. - Beta:
@better-auth/[email protected]or later.
The fix resolves the org id once in the middleware. It passes that single value to the handler. The approved org and the acted-on org are now always the same.
Frequently Asked Questions
- What is GHSA-H3RM-78G3-J7CP? GHSA-H3RM-78G3-J7CP is a high-severity incorrect authorization vulnerability in @better-auth/stripe (npm), affecting versions >= 1.4.11, < 1.6.21. It is fixed in 1.6.21, 1.7.0-beta.10. The application does not correctly enforce access controls, allowing a principal to access resources or operations beyond their granted permissions.
- How severe is GHSA-H3RM-78G3-J7CP? GHSA-H3RM-78G3-J7CP has a CVSS score of 7.1 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of @better-auth/stripe are affected by GHSA-H3RM-78G3-J7CP? @better-auth/stripe (npm) versions >= 1.4.11, < 1.6.21 is affected.
- Is there a fix for GHSA-H3RM-78G3-J7CP? Yes. GHSA-H3RM-78G3-J7CP is fixed in 1.6.21, 1.7.0-beta.10. Upgrade to this version or later.
- Is GHSA-H3RM-78G3-J7CP exploitable, and should I be worried? Whether GHSA-H3RM-78G3-J7CP is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether GHSA-H3RM-78G3-J7CP is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix GHSA-H3RM-78G3-J7CP?
- Upgrade
@better-auth/stripeto 1.6.21 or later - Upgrade
@better-auth/stripeto 1.7.0-beta.10 or later
- Upgrade