---
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.21455
ingestedAt: '2026-07-09T18:56:36.326Z'
---

## Overview

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.

## Affected packages

- `github.com/yuin/goldmark/renderer/html < 1.7.17`

## Remediation

Upgrade to a patched release:

- `github.com/yuin/goldmark/renderer/html 1.7.17`
