The vulnerability exists in the handoffChatLinkSession function, which handles the GET /api/chat-links/:instance/:token/handoff API endpoint. This function is designed to link an external chat identity (like Slack or Discord) to a Budibase user account. The vulnerability stems from two critical security flaws: lack of CSRF protection and missing user consent. The endpoint performs a sensitive, state-changing action on a GET request, which is inherently insecure against CSRF attacks. An attacker can generate a link token associated with their own external chat account and trick an authenticated Budibase user (the victim) into clicking the link. When the victim's browser makes the GET request, the server links the attacker's chat identity to the victim's Budibase session, granting the attacker the ability to perform actions as the victim through the AI chat agent. The patch remediates this by changing the workflow to a two-step process. The GET request to handoffChatLinkSession now displays a consent page. The actual account linking is moved to a new confirmChatLinkSession function that only responds to POST requests and requires a confirmation token, effectively mitigating the CSRF vulnerability and ensuring user consent is obtained.