CVE-2026-5160: Github.com/yuin/goldmark/renderer/html Cross-Site Scripting Vulnerability
MODERATECVE-2026-5160 is a MODERATE (CVSS 6.1) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Github.com/yuin/goldmark/renderer/html libraries in the Go ecosystem. The issue involves goldmark vulnerable to cross-site scripting (xss). Remediation is available by upgrading affected packages to version 1.7.17.
CVE-2026-5160 at a Glance
Security Impact
CVSS: 6.1
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N).
How to Fix CVE-2026-5160
To remediate this vulnerability, upgrade all affected Github.com/yuin/goldmark/renderer/html dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/yuin/goldmark/renderer/html to 1.7.17
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/yuin/goldmark/renderer/html
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-5160, inspect your project dependencies for Github.com/yuin/goldmark/renderer/html:
inspect dependencies for github.com/yuin/goldmark/renderer/html
Analyze the terminal output to locate any version of Github.com/yuin/goldmark/renderer/html in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.7.17), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Github.com/yuin/goldmark/renderer/html, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-5160 Affected Github.com/yuin/goldmark/renderer/html Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/yuin/goldmark/renderer/html
|
Go |
< 1.7.17
|
1.7.17
|
References
Frequently Asked Questions
What is CVE-2026-5160?
Which Github.com/yuin/goldmark/renderer/html versions are affected?
What version fixes CVE-2026-5160?
Is github.com/yuin/goldmark/renderer/html affected?
What is the CVSS score of CVE-2026-5160?
What CWE is associated with CVE-2026-5160?
How can I check Go dependencies for CVE-2026-5160?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-c97m-vxhj-p7j6",
"modified" : "2026-04-18T01:02:42Z",
"published" : "2026-04-17T15:31:17Z",
"aliases" : [ "CVE-2026-5160" ],
"summary" : "goldmark vulnerable to Cross-site Scripting (XSS)",
"details" : "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:alert(1) is not recognized as dangerous during validation, leading to arbitrary script execution in the context of applications that render the URL.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
}, {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/yuin/goldmark/renderer/html"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.7.17"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-5160"
}, {
"type" : "WEB",
"url" : "https://github.com/yuin/goldmark/commit/cb46bbc4eca29d55aa9721e04ad207c23ccc44f9"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/yuin/goldmark"
}, {
"type" : "WEB",
"url" : "https://security.snyk.io/vuln/SNYK-GOLANG-GITHUBCOMYUINGOLDMARKRENDERERHTML-15838406"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-04-18T01:02:42Z",
"nvd_published_at" : "2026-04-15T06:16:13Z"
}
}