The vulnerability is a DOM-based Cross-Site Scripting (XSS) issue within the Blitz.js framework's sign-in functionality. The root cause is the improper handling of the next URL parameter, which is intended to redirect users after a successful login. The application code retrieves this parameter from the URL and passes it to the router.push() function without adequate validation or sanitization. An attacker can craft a malicious URL containing a javascript: payload in the next parameter. When a user clicks this link and successfully authenticates, the malicious JavaScript is executed in the context of the user's browser. This can lead to session hijacking, credential theft, or other unauthorized actions. The vulnerability is present in multiple template files generated by the framework for both the Pages Router and App Router implementations in Next.js, as detailed in the provided Gist.