The x/tools/gopls/internal/golang/freesymbols package's sourceLink function (https://go.googlesource.com/tools/+/refs/tags/v0.47.0/gopls/internal/golang/freesymbols.go#418) includes an unsanitized filename in HTML output. A malicious package with a filename such as <script>alert(1)</script> can inject XSS into the HTML.
Thanks to sorte for reporting this issue.
This is a PUBLIC track vulnerability and CVE-2026-56856.
The x/tools/gopls/internal/golang/freesymbols package's sourceLink function (https://go.googlesource.com/tools/+/refs/tags/v0.47.0/gopls/internal/golang/freesymbols.go#418) includes an unsanitized filename in HTML output. A malicious package with a filename such as
<script>alert(1)</script>can inject XSS into the HTML.Thanks to sorte for reporting this issue.
This is a PUBLIC track vulnerability and CVE-2026-56856.