Vulnerabilities in pkg:npm/@better-auth/stripe

PACKAGE
Advisory Summary

GHSA-h3rm-78g3-j7cp is a HIGH (CVSS 7.1) cross-organization billing tampering vulnerability (CWE-639: Authorization Bypass Through User-Controlled Key) affecting @better-auth/stripe libraries in the npm ecosystem. The issue involves cross-organization billing tampering in organization subscription actions. Remediation is available by upgrading affected packages to version 1.6.21, 1.7.0-beta.10.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/@better-auth/stripe

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/@better-auth/stripe. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-h3rm-78g3-j7cp - HIGH @better-auth/stripe: cross-organization billing tampering in organization subscription actions

GHSA-h3rm-78g3-j7cp at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-h3rm-78g3-j7cp
Severity HIGH
CVSS v3.1 Base Score 7.1
CWE Classification CWE-639: Authorization Bypass Through User-Controlled Key
Affected Product @better-auth/stripe
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity High (I:H)
Availability None (A:N)

How to Fix GHSA-h3rm-78g3-j7cp

To remediate this vulnerability, upgrade all affected @better-auth/stripe dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@better-auth/stripe fixed: 1.6.21
npm install @better-auth/stripe@1.6.21
@better-auth/stripe fixed: 1.7.0-beta.10
npm install @better-auth/stripe@1.7.0-beta.10
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @better-auth/stripe

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-h3rm-78g3-j7cp, inspect your project dependencies using npm:

npm ls @better-auth/stripe

Analyze the terminal output to locate any version of @better-auth/stripe in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.6.21), your application is affected.

Note: The npm ls @better-auth/stripe command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-639: Authorization Bypass Through User-Controlled Key, where the system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data. In @better-auth/stripe, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Am I affected? You are affected if all of these are true: - You use `@better-auth/stripe` from 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 an `authorizeReference` callback. - 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. ### Summary 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. ### Patches Upgrade to one of these patched versions: - Stable: `@better-auth/stripe@1.6.21` or later. - Beta: `@better-auth/stripe@1.7.0-beta.10` 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. ### 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: ```ts if (referenceId !== session.activeOrganizationId) { return false; } ``` This forces the approved org and the active org to be the same value. ### 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. ### Credit Reported and fixed by Taesu ([@bytaesu](https://github.com/bytaesu)).

GHSA-h3rm-78g3-j7cp Affected @better-auth/stripe Versions

2 component(s)
Fixed Versions:
1.6.211.7.0-beta.10
Product / Package Ecosystem Affected Versions Fixed Version
@better-auth/stripe
npm
≥ 1.4.11
< 1.6.21
1.6.21
@better-auth/stripe
npm
≥ 1.7.0-beta.0
< 1.7.0-beta.10
1.7.0-beta.10

References

Frequently Asked Questions

What is GHSA-h3rm-78g3-j7cp?
GHSA-h3rm-78g3-j7cp is a security vulnerability in @better-auth/stripe involving cross-organization billing tampering in organization subscription actions under CWE-639: Authorization Bypass Through User-Controlled Key.
Which @better-auth/stripe versions are affected?
Affected versions include releases prior to 1.6.21, 1.7.0-beta.10 across affected packages: @better-auth/stripe.
What version fixes GHSA-h3rm-78g3-j7cp?
Upgrading to 1.6.21, 1.7.0-beta.10 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @better-auth/stripe affected?
Yes, @better-auth/stripe is affected in releases prior to 1.6.21, 1.7.0-beta.10. Upgrade your dependency to 1.6.21, 1.7.0-beta.10 or later.
What is the CVSS score of GHSA-h3rm-78g3-j7cp?
GHSA-h3rm-78g3-j7cp has a CVSS v3.1 base score of 7.1 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N.
What CWE is associated with GHSA-h3rm-78g3-j7cp?
GHSA-h3rm-78g3-j7cp is classified under CWE-639: Authorization Bypass Through User-Controlled Key (The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data.).
How can I check npm dependencies for GHSA-h3rm-78g3-j7cp?
Run the dependency tree command: 'npm ls @better-auth/stripe'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-h3rm-78g3-j7cp",
  "modified" : "2026-07-24T15:43:22Z",
  "published" : "2026-07-24T15:43:22Z",
  "aliases" : [ ],
  "summary" : "@better-auth/stripe: cross-organization billing tampering in organization subscription actions",
  "details" : "### Am I affected?\n\nYou are affected if all of these are true:\n\n- You use `@better-auth/stripe` from 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.\n- The Stripe plugin has subscriptions turned on (`subscription.enabled: true`).\n- Organization subscriptions are turned on (`organization.enabled: true`) and you have set an `authorizeReference` callback.\n- A user can join more than one org. So a user can be a member of an org whose billing they should not manage.\n\nYou are not affected if you only use user subscriptions. You are also not affected if org subscriptions are turned off.\n\n### Summary\n\nAn 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.\n\n### Details\n\nThe 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.\n\nThe 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.\n\n### Patches\n\nUpgrade to one of these patched versions:\n\n- Stable: `@better-auth/stripe@1.6.21` or later.\n- Beta: `@better-auth/stripe@1.7.0-beta.10` or later.\n\nThe 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.\n\n### Workarounds\n\nIf 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:\n\n```ts\nif (referenceId !== session.activeOrganizationId) {\n  return false;\n}\n```\n\nThis forces the approved org and the active org to be the same value.\n\n### Impact\n\n- 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.\n- Through the billing portal, a member can reach another org's billing details. This includes payment methods, invoices, and subscription state.\n\n### Credit\n\nReported and fixed by Taesu ([@bytaesu](https://github.com/bytaesu)).",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@better-auth/stripe"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.4.11"
      }, {
        "fixed" : "1.6.21"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@better-auth/stripe"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.7.0-beta.0"
      }, {
        "fixed" : "1.7.0-beta.10"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/better-auth/better-auth/security/advisories/GHSA-h3rm-78g3-j7cp"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/better-auth/better-auth/commit/29fbcb573261242d8a05b131a9d39c9ae4352b06"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/better-auth/better-auth"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/better-auth/better-auth/releases/tag/v1.6.21"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/better-auth/better-auth/releases/tag/v1.7.0-beta.10"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-639", "CWE-863" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-24T15:43:22Z",
    "nvd_published_at" : null
  }
}