GHSA-v7j5-vc4m-723w Budibase has an Account Impersonation Issue — Chat Identity Link Hijacking via Missing Consent & CSRF
Title**Chat Identity Link Hijacking — Attacker Can Silently Map Their Slack/Discord Identity to Any Authenticated Budibase User's Account**Severity**High** — CVSS 3.1: AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N = **7.3**Affected Product**Product:** Budibase**Version:** 3.37.2 (introduced in this version)**Component:** `packages/server/src/api/controllers/ai/chatIdentityLinks.ts`**Endpoint:** `GET /api/chat-links/:instance/:token/handoff`Vulnerability TypeCWE-352: Cross-Site Request ForgeryCWE-284: Improper Access ControlVulnerability Description`GET /api/chat-links/:instance/:token/handoff` is a **public endpoint** (no auth required) that performs a permanent, state-changing operation: it binds an external chat identity (Slack/Discord/MS Teams) to an authenticated Budibase user account, with **no consent UI and no CSRF protection**.The session token in the URL is created **by the attacker** (from their own `/link` slash command) and embeds **the attacker's `externalUserId`**. When an authenticated Budibase victim visits the URL, their account is silently and permanently linked to the attacker's Slack/Discord identity. The server responds with `"Authentication succeeded."` — no indication of what was linked.Route RegistrationVulnerable Controller (full function)--Step 1 — Attacker triggers `/link` in SlackAttacker types `/link` to the Budibase Slack bot. Budibase server creates a Redis session:**Redis key:** `chatIdentityLinkSession:tok_xxxxxxxxxxxxxxxx`**Redis value (exact structure from `ChatIdentityLinkSession` interface):**Slack DM sent privately to attacker:**Key observation:** This URL embeds the attacker's own `externalUserId` inside the token. The attacker has full control over which identity gets linked.Step 2 — Attacker forwards URL to victimAttacker posts in the company Slack:Step 3 — Victim clicks link (authenticated)**HTTP Request (victim's browser):****HTTP Response:**The victim sees "Authentication succeeded." with no mention of Slack, no mention of `attacker`, no mention of what capabilities were granted.**CouchDB global-db document written immediately after (exact structure from `upsertChatIdentityLink`):**The mapping is now permanent. `externalUserId = UA12345678` (attacker) → `globalUserId = ro_global_us_VICTIM_ADMIN_ID` (victim).Step 4 — Attacker impersonates victim via AI agentAttacker sends any message to the Budibase Slack bot from their own account (`UA12345678`).The chat handler resolves the identity:The attacker can now ask the agent:"Show me all rows in the Customers table"
"Trigger the 'Send Invoice' automation for customer ID 42"
"What files are in the knowledge base?"Each request runs with the victim admin's identity and permissions. The victim has no indication this is happening.Step 3b — Variant: Victim Not Yet AuthenticatedIf the victim is not currently logged in when they click the URL:**HTTP Request:****HTTP Response:**After the victim logs in, the browser follows the return URL and the attack completes identically to Step 3.RemediationMinimum Fix — Add Consent PageConvert the handoff to a two-step flow:Moving the write to `POST` removes it from `publicRoutes`, making Budibase's existing CSRF middleware apply automatically.Credits,
Vishal Kumar B
https://github.com/VishaaLlKumaaRrReferences`packages/server/src/api/routes/chat.ts:22` — public route registration`packages/server/src/api/controllers/ai/chatIdentityLinks.ts:61–110` — full vulnerable controller`packages/server/src/sdk/workspace/ai/chatIdentityLinks.ts:135–165` — session creation (embeds attacker's externalUserId)`packages/server/src/sdk/workspace/ai/chatIdentityLinks.ts:202–247` — upsertChatIdentityLink (permanent write)`packages/server/src/api/controllers/webhook/chatHandler.ts:421` — identity resolution during agent message handling`packages/server/src/ai/tools/budibase/automations.ts` — automation trigger capability`packages/server/src/ai/tools/budibase/rows.ts` — row read/write capability`packages/types/src/sdk/chatIdentityLinks.ts` — session + link type definitionsCWE-352: Cross-Site Request ForgeryCWE-284: Improper Access Control
CVSS v3.1 score: 7.3