CVE-2026-5160 goldmark vulnerable to Cross-site Scripting (XSS)
An attacker can execute arbitrary scripts by bypassing URL validation in the goldmark HTML renderer, affecting applications using this Go library.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2026-5160?
CVE-2026-5160 is a medium-severity cross-site scripting vulnerability in github.com/yuin/goldmark/renderer/html, published on 15 Apr 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Official description
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.
Weakness: CWE-79
Which versions are affected by CVE-2026-5160?
3 open source packages ship an affected version, including github.com/yuin/goldmark/renderer/html and github.com/yuin/goldmark. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
github.com/yuin/goldmark/renderer/html Go | All versions | 1.7.17 |
github.com/yuin/goldmark/renderer/html Go | All versions | 1.7.17 |
github.com/yuin/goldmark Go | All versions | 1.7.17 |
Products include Yuin Goldmark.
How do I fix CVE-2026-5160?
Upgrade github.com/yuin/goldmark/renderer/html to 1.7.17 or later.
Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.
Is CVE-2026-5160 being exploited?
There is no known exploitation of CVE-2026-5160 in the wild and no public exploit code.
Sources
Also known as AZL-83048, AZL-83060, BELL-CVE-2026-5160, CLEANSTART-2026-QG09964, DEBIAN-CVE-2026-5160, GHSA-c97m-vxhj-p7j6 and 16 more.