<?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>Aegra — CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/vendors/aegra/</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, 09 Jan 2024 12:00:00 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/vendors/aegra/feed.xml" rel="self" type="application/rss+xml"/><item><title>Aegra Cross-Tenant IDOR in Thread Run Creation</title><link>https://feed.craftedsignal.io/briefs/2024-01-aegra-idor/</link><pubDate>Tue, 09 Jan 2024 12:00:00 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2024-01-aegra-idor/</guid><description>Aegra versions 0.9.0 through 0.9.6 are vulnerable to a cross-tenant IDOR, enabling authenticated users to execute graph runs against other users' threads, read checkpoint states, inject messages, and conceal their actions due to missing user ID validation on run creation endpoints; patched in version 0.9.7.</description><content:encoded><![CDATA[<p>A cross-tenant IDOR vulnerability affects Aegra deployments running versions 0.9.0 through 0.9.6 where multiple authenticated users share an instance. An authenticated user (User A) can exploit this by leveraging another user&rsquo;s <code>thread_id</code> (User B) to perform unauthorized actions. User A can execute graph runs against User B&rsquo;s thread, read User B&rsquo;s full checkpoint state, inject arbitrary messages into User B&rsquo;s conversation history, and hide their activity from User B&rsquo;s <code>GET /threads/{thread_id}/runs</code> listing. The issue arises because the run carries A&rsquo;s <code>user_id</code>, not B&rsquo;s. The streaming variant of the run creation endpoints exacerbates the vulnerability by returning the entire prior <code>messages</code> array immediately upon connection, without requiring graph execution. This vulnerability was discovered by @JoJoTheBizarre and resolved in version 0.9.7.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>User A authenticates to the Aegra application.</li>
<li>User A obtains User B&rsquo;s <code>thread_id</code> through frontend URLs, server logs, observability traces, or shared links.</li>
<li>User A crafts a <code>POST</code> request to <code>/threads/{thread_id}/runs</code>, <code>/threads/{thread_id}/runs/stream</code>, or <code>/threads/{thread_id}/runs/wait</code>, replacing <code>{thread_id}</code> with User B&rsquo;s <code>thread_id</code>.</li>
<li>The Aegra application fails to validate that User A owns the target <code>thread_id</code> due to a missing <code>user_id</code> filter at the SQL layer.</li>
<li>The request executes a graph run within User B&rsquo;s thread context, using User A&rsquo;s credentials.</li>
<li>User A reads User B&rsquo;s full checkpoint state via the resulting run&rsquo;s <code>output</code> field (or via SSE events in the streaming variant).</li>
<li>User A injects arbitrary messages into User B&rsquo;s conversation history, which are then persisted in User B&rsquo;s checkpoint.</li>
<li>User A&rsquo;s actions are hidden from User B&rsquo;s thread run listing because the run is associated with User A&rsquo;s <code>user_id</code>.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>Successful exploitation allows an attacker to execute arbitrary code within another user&rsquo;s context, potentially leading to data exfiltration, modification of user data, and disruption of service. With multiple authenticated users on a shared instance, any user can read the full checkpoint state or inject arbitrary messages into another user&rsquo;s conversation history. If streaming is enabled the attacker can read the full conversation history without further steps.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Upgrade Aegra deployments to version 0.9.7 or later to address the vulnerability as per the patch notes.</li>
<li>If upgrading is not immediately feasible, implement the workaround by registering an <code>@auth.on(&quot;threads&quot;, &quot;create_run&quot;)</code> handler that explicitly verifies thread ownership against the authenticated identity before allowing the operation, as detailed in the workaround section.</li>
<li>Monitor web server logs for suspicious <code>POST</code> requests to the affected endpoints (<code>/threads/{thread_id}/runs</code>, <code>/threads/{thread_id}/runs/stream</code>, <code>/threads/{thread_id}/runs/wait</code>) originating from unexpected IP addresses using the Sigma rule &ldquo;Detect Aegra Cross-Tenant IDOR Attempt&rdquo;.</li>
</ul>
]]></content:encoded><category domain="severity">high</category><category domain="type">advisory</category><category>idor</category><category>privilege-escalation</category><category>credential-access</category><category>defense-evasion</category></item></channel></rss>