{"id":"CVE-2026-5160","aliases":["GHSA-c97m-vxhj-p7j6","GO-2026-5320"],"title":"goldmark vulnerable to Cross-site Scripting (XSS)","summary":"goldmark vulnerable to Cross-site Scripting (XSS)","severity":"medium","cvss":6.1,"cvssVector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","vendor":"yuin","product":"github.com/yuin/goldmark/renderer/html","ecosystem":"go","affected":["github.com/yuin/goldmark/renderer/html < 1.7.17"],"patched":["github.com/yuin/goldmark/renderer/html 1.7.17"],"published":"2026-04-17","updated":"2026-07-07","source":"OSV","sourceUrl":"https://osv.dev/vulnerability/GHSA-c97m-vxhj-p7j6","references":[{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-5160"},{"url":"https://github.com/yuin/goldmark/commit/cb46bbc4eca29d55aa9721e04ad207c23ccc44f9"},{"url":"https://github.com/yuin/goldmark"},{"url":"https://security.snyk.io/vuln/SNYK-GOLANG-GITHUBCOMYUINGOLDMARKRENDERERHTML-15838406"}],"tags":["osv","go"],"epss":0.00287,"epssPercentile":0.2145,"ingestedAt":"2026-07-09T18:56:36.326Z","slug":"CVE-2026-5160","body":"## Overview\n\nVersions of the package github.com/yuin/goldmark/renderer/html before 1.7.17 are vulnerable to Cross-site Scripting (XSS) due to improper ordering of URL validation and normalization. The renderer validates link destinations using a prefix-based check (IsDangerousURL) before resolving HTML entities. This allows an attacker to bypass protocol filtering by encoding dangerous schemes using HTML5 named character references. For example, a payload such as javascript&colon;alert(1) is not recognized as dangerous during validation, leading to arbitrary script execution in the context of applications that render the URL.\n\n## Affected packages\n\n- `github.com/yuin/goldmark/renderer/html < 1.7.17`\n\n## Remediation\n\nUpgrade to a patched release:\n\n- `github.com/yuin/goldmark/renderer/html 1.7.17`","depth":"sunlit","depthScore":34,"depthScoreParts":{"impact":33.6,"likelihood":0.1,"exploitation":0,"ransomware":0},"changes":[]}