The vulnerability lies in a failure to re-validate the browser's current URL against the application's Server-Side Request Forgery (SSRF) policy after a user-driven browser interaction. Functions like clickViaPlaywright, pressKeyViaPlaywright, and evaluateViaPlaywright simulate user actions. An attacker could create a scenario where these actions trigger a client-side redirect (e.g., using JavaScript) to an internal or otherwise restricted URL.
Prior to the fix, the application performed an SSRF check upon initial navigation but did not re-run this check after these in-page interactions. This created a window of opportunity for an attacker to bypass the SSRF policy. For example, a click could navigate the browser to an internal server, and a subsequent call to a snapshot function (snapshotAiViaPlaywright, etc.) would then read the content of that internal page, exfiltrating sensitive information.
The patch addresses this by introducing a robust, multi-phase navigation guard (assertInteractionNavigationCompletedSafely) that is applied after any interaction that could potentially cause navigation. This guard checks for URL changes immediately after the action and also waits for a brief period to catch delayed, script-triggered navigations, thus closing the SSRF bypass loophole.