Skip to content

x/tools/gopls: unsanitized source filename in HTML package documentation #80218

Description

@neild

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.

Metadata

Metadata

Assignees

Labels

DocumentationIssues describing a change to documentation.ToolsThis label describes issues relating to any tools in the x/tools repository.goplsIssues related to the Go language server, gopls.

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions