The vulnerability exists in the http/static.go file where the Go text/template package was used to render the application's main page. The text/template package does not perform any HTML escaping, which allowed for a stored Cross-site Scripting (XSS) vulnerability. An administrator could set a malicious payload in the branding.name setting. This payload, containing JavaScript, would then be rendered unescaped in the <title> tag of the HTML page for all visitors. The fix was to switch to the html/template package, which provides automatic, context-aware escaping of data. The commit d9f9460c1e51d10a25065e10358c12d5ced66ad9 shows this change. Additionally, commit c406bda0c73ac8b187e23a97c05521edc77efa84 further hardens the fix by using template.JS to safely embed JSON data into the page within the handleWithStaticData function. Therefore, fbhttp.handleWithStaticData is the primary vulnerable function.