The vulnerability lies in the fact that the user's API key is embedded directly into the HTML of the administrative dashboard. My analysis of the source code, specifically the controllers/route.go file, reveals that the newTemplateParams function is responsible for this. It fetches the models.User object, which includes the sensitive API key, and prepares it for rendering in the template. This data is then passed to any of the handlers that render a page, such as Base, Campaigns, etc. Since no patch is available, the identified vulnerable function is the one that prepares the data for the template. An attacker with the ability to execute JavaScript in the administrator's browser can steal this key and gain persistent, unauthorized access to the Gophish API.