{"id":"CVE-2026-5160","aliases":["CVE-2026-5160","GHSA-c97m-vxhj-p7j6","GO-2026-5320"],"related":["CGA-472v-6vrr-8c84"],"kind":"vulnerability","state":"published","title":"goldmark vulnerable to Cross-site Scripting (XSS)","summary":"Versions 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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Versions 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.","source":"cvelist"},{"lang":"en","text":"Cross-site Scripting (XSS) in github.com/yuin/goldmark","format":"markdown","source":"go"}],"published":"2026-04-15T05:00:01.655Z","modified":"2026-09-10T03:50:43.784Z","severity":{"scorer":"snyk","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:L/VA:N/SC:L/SI:L/SA:N","score":5.1,"rating":"MEDIUM"},"severities":[{"scorer":"snyk","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:L/VA:N/SC:L/SI:L/SA:N","score":5.1,"rating":"MEDIUM"},{"scorer":"snyk","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:L/VA:N/SC:L/SI:L/SA:N","rating":"MEDIUM"}],"cwes":["CWE-79"],"affected":[{"ranges":[{"type":"semver","introduced":"0","fixed":"1.7.17","status":"affected"}],"product":"github.com/yuin/goldmark/renderer/html","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.7.17"}],"ecosystem":"Go","package":"github.com/yuin/goldmark/renderer/html","purl":"pkg:golang/github.com/yuin/goldmark/renderer/html","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.7.17"}],"ecosystem":"Go","package":"github.com/yuin/goldmark","purl":"pkg:golang/github.com/yuin/goldmark","source":"go"},{"ranges":[{"status":"affected","fixed":"1.7.17"}],"vendor":"yuin","product":"goldmark","cpe":"cpe:2.3:a:yuin:goldmark:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://security.snyk.io/vuln/SNYK-GOLANG-GITHUBCOMYUINGOLDMARKRENDERERHTML-15838406","tags":["mitigation","third-party-advisory","web"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/yuin/goldmark/commit/cb46bbc4eca29d55aa9721e04ad207c23ccc44f9","tags":["fix","patch","web"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-5160","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/yuin/goldmark","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/advisories/GHSA-c97m-vxhj-p7j6","tags":["advisory"],"sources":["go"]}],"credits":["Catalin Iovita (Snyk Security Research)"],"assigner":"snyk","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-04-15T18:07:02.033Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-5160","url":"https://www.cve.org/CVERecord?id=CVE-2026-5160","licence":"CVE Terms of Use","modified":"2026-04-15T18:07:10.025Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-c97m-vxhj-p7j6","url":"https://github.com/advisories/GHSA-c97m-vxhj-p7j6","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:43.784Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-5320","url":"https://pkg.go.dev/vuln/GO-2026-5320","licence":"CC-BY-4.0","modified":"2026-07-22T20:59:36.886Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-5160","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-5160","licence":"Public domain","modified":"2026-06-17T10:58:31.247Z"}],"updatedAt":"2026-11-25T22:59:18.818Z","epss":{"score":0.00354,"percentile":0.21516,"date":"2026-11-30T12:00:22.000Z"}}