Advisory

GHSA-pvcr-8mvp-w8qr

Details, part 2 of 2. The advisory

Details

   <form id="f" method="post" action="https://victim.budibase.app/api/chat-links/app_xxx/linktoken/handoff">
     <input name="confirmationToken" value="<leaked-token>">
   </form>
   <script>document.getElementById('f').submit()</script>
  1. Victim (a Budibase user in tenant T, e.g. an admin) is lured to the attacker page while logged into Budibase. Their browser sends the POST cross-origin. If the Budibase auth cookie is sent on cross-site requests (SameSite=Lax by default allows top-level POST navigations, which a form-submit is), the request is authenticated as the victim.
  1. The victim's `globalUserId` is now bound to the attacker's Slack identity. When the attacker DMs the AI agent from Slack, the agent's operations run as the victim user -> with the victim's permissions on agent operations, knowledge sources, file uploads, and any downstream automation steps keyed off the linked identity.

Mitigating factors:

  • SameSite=Lax cookies block cross-site POSTs from sub-resources (fetch / XHR) but allow top-level form-POST navigations. A phishing page that submits the form via document.form.submit() (a top-level navigation) succeeds. So the CSRF works with the default cookie policy.
  • The attack is same-tenant only (session.tenantId !== context.getTenantId() is checked in the sdk).
  • The attacker must induce the victim to click a link (standard phishing). No silent drive-by.

---

Impact

| Capability | Available |
|---|---|
| Bind an attacker-controlled chat identity to a victim's Budibase account | ✅ |
| Send messages to the AI agent as the victim user (Slack/Discord/MS Teams/Telegram) | ✅ |
| Inherit the victim's permissions on agent operations | ✅ |
| Trigger automations / agent operations that the victim is authorised for | ✅ |
| Read knowledge sources the victim has access to | ✅ |

The severity depends on what the agent can do as the victim. For an admin victim, this is full tenant administration via chat. For a regular user, it is impersonation within the agent subsystem. The bound identity persists until manually unlinked, so the attacker retains ongoing access.

This is a same-tenant, user-interaction-required primitive. It is below the "unauthenticated RCE" threshold but above "hardening" -> it is a real authentication-confusion vulnerability on a sensitive identity-binding operation.

---

Fix

Recommended layered fixes:

  1. Bind the confirmation token to the requester's Budibase session at preparation time. In prepareChatIdentityLinkSessionConfirmation, store the globalUserId of the requester alongside the confirmationToken. In confirmChatLinkSession, verify that getCurrentGlobalUserId(ctx) matches the stored requester. This breaks the CSRF / cross-user confusion.
  1. Add a CSRF token to the confirmation POST. The standard Budibase CSRF synchroniser token (x-csrf-token header, validated against the session's csrfToken) should be enforced on POST /api/chat-links/.../handoff. Move the route out of publicRoutes to an authenticated route group so CSRF applies (the GET can remain public for the redirect-to-login flow; the POST should be authenticated + CSRF-protected).
  1. Add a per-session nonce that is bound to the requester's browser (e.g. a signed cookie set on the GET, validated on the POST) to prevent cross-origin submission even when SameSite=Lax allows it.
  1. Require user re-authentication (re-entry of password / step-up auth) for sensitive identity-binding operations, similar to how password change requires re-auth.

Sources & licences