The vulnerability in Summarize prior to version 0.15.0 allowed an attacker to execute browser automation actions without explicit user consent. This was due to a missing authorization check when the AI agent decided to use a "tool call," such as navigating to a new page or interacting with the browser's debugger.
The analysis of the security patch in commit e64fe3ecd1bb4fdc181dcfa88c96b9e1914ced0e reveals that the core issue resided in the runChatAgentLoop function. This function processes instructions from the AI model and, in vulnerable versions, would directly execute any requested tool calls. An attacker could influence the agent through malicious page content, causing it to generate a harmful tool call that would be executed without any user prompt.
The fix involves two key functions:
runChatAgentLoop: This function was modified to accept a new confirmToolCall callback. Before executing a tool, it now invokes this callback to get user approval. If approval is denied, the tool call is cancelled.
runAgentLoop: This function, which initiates the agent process, was updated to create and supply the confirmAutomationToolCall function to runChatAgentLoop. This new function is responsible for showing a window.confirm() dialog to the user, clearly describing the action the agent wants to take and asking for explicit approval.
During an exploit, the runAgentLoop function would start the process, and the runChatAgentLoop function would be on the call stack as it processes the malicious tool call without prompting the user. Therefore, both functions are critical runtime indicators of the vulnerability.