<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Application-Library - CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/tags/application-library/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata. Fed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Fri, 24 Jul 2026 15:46:24 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/tags/application-library/feed.xml" rel="self" type="application/rss+xml"/><item><title>Authorization Bypass in @better-auth/stripe Allows Cross-Organization Billing Tampering</title><link>https://feed.craftedsignal.io/briefs/2026-07-better-auth-stripe-tampering/</link><pubDate>Fri, 24 Jul 2026 15:46:24 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-07-better-auth-stripe-tampering/</guid><description>An authorization bypass vulnerability in the `@better-auth/stripe` library allows authenticated users to perform subscription actions (cancel, change plan, restore, open billing portal) against other organizations they are a member of, but not authorized to manage. This occurs due to inconsistent handling of organization IDs between the middleware, which approves the ID from the request query string, and the route handler, which acts on the active organization ID from the session or request body. This flaw enables users to access sensitive billing details and manipulate subscriptions for unintended organizations.</description><content:encoded><![CDATA[<p>A high-severity authorization bypass vulnerability exists in the <code>@better-auth/stripe</code> library, specifically affecting versions 1.4.11 through 1.6.20 (stable) and 1.7.0-beta.0 through 1.7.0-beta.9 (beta). This flaw allows authenticated users to perform unauthorized subscription actions, such as canceling, changing plans, restoring subscriptions, or accessing the billing portal, for organizations they are a member of but not explicitly authorized to manage. The vulnerability stems from an inconsistency in how organization IDs are handled between the library's middleware and its route handler. The middleware, responsible for authorization, approves an organization ID provided in the request query string, while the route handler, which executes the action, defaults to using the active organization ID from the user's session if no ID is present in the request body. This discrepancy enables an attacker to bypass authorization checks and manipulate billing for an unintended organization, potentially leading to financial damage and sensitive data exposure.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker, possessing a valid user account, authenticates to an application using the vulnerable <code>@better-auth/stripe</code> library.</li>
<li>The attacker is a member of at least two organizations (e.g., Organization A and Organization B), where they are authorized to manage billing for Organization A but not Organization B.</li>
<li>The attacker intends to perform an unauthorized subscription action (e.g., cancel a subscription) on Organization B.</li>
<li>The attacker crafts an HTTP request for a subscription action, including Organization A's ID in the request's query string (e.g., <code>?orgId=OrgA_ID</code>).</li>
<li>The crafted request deliberately omits Organization B's ID from the request body or sends an empty body.</li>
<li>The <code>@better-auth/stripe</code> middleware processes the request, validating the <code>OrgA_ID</code> from the query string via the <code>authorizeReference</code> callback, thereby approving the request.</li>
<li>The request proceeds to the route handler. Since no organization ID is found in the request body, the handler defaults to using the attacker's <code>session.activeOrganizationId</code>, which is set to <code>OrgB_ID</code>.</li>
<li>The subscription action is then executed against Organization B, allowing the attacker to manipulate its billing or access its sensitive billing details without proper authorization.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation of this vulnerability enables an authenticated user to perform unauthorized subscription actions, including cancellation, plan changes, restoration, or access to the billing portal, on organizations they are a member of but lack specific billing management authorization for. This directly impacts the targeted organizations, potentially leading to financial losses due to unwarranted subscription changes or cancellations. Furthermore, accessing another organization's billing portal exposes sensitive financial data, such as payment methods, invoices, and subscription states, to the unauthorized user. The scope of impact is limited to organizations that the attacker's user account is a member of.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade to <code>@better-auth/stripe@1.6.21</code> or later (for stable versions) or <code>@better-auth/stripe@1.7.0-beta.10</code> or later (for beta versions) to patch the vulnerability.</li>
<li>If immediate upgrade is not possible, implement the recommended workaround by modifying the <code>authorizeReference</code> callback to ensure the <code>referenceId</code> matches <code>session.activeOrganizationId</code>, returning <code>false</code> otherwise.</li>
<li>Configure web server logs to capture full HTTP request details, including query strings and request bodies, to aid in forensic analysis of suspicious activity.</li>
<li>Review application-specific logs for instances where the <code>authorizeReference</code> callback approves an organization ID that differs from the <code>session.activeOrganizationId</code> during subscription actions, indicating a potential exploit attempt.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>authorization-bypass</category><category>web-application</category><category>supply-chain</category><category>application-library</category></item></channel></rss>