Vulnerabilities in pkg:golang/github.com/yuin/goldmark/renderer/html

PACKAGE
Advisory Identifier: GHSA-c97m-vxhj-p7j6
Advisory Summary

CVE-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.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/yuin/goldmark/renderer/html

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/yuin/goldmark/renderer/html. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-c97m-vxhj-p7j6 CVE-2026-5160 MODERATE goldmark vulnerable to Cross-site Scripting (XSS)

CVE-2026-5160 at a Glance

CVE Identifier CVE-2026-5160
GHSA Identifier GHSA-c97m-vxhj-p7j6
Severity MODERATE
CVSS v3.1 Base Score 6.1
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Github.com/yuin/goldmark/renderer/html
Package Ecosystem Go
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (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.

github.com/yuin/goldmark/renderer/html fixed: 1.7.17
Upgrade github.com/yuin/goldmark/renderer/html to 1.7.17
Verify Direct and Transitive Dependencies

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

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.

CVE-2026-5160 Affected Github.com/yuin/goldmark/renderer/html Versions

1 component(s)
Fixed Versions:
1.7.17
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?
CVE-2026-5160 is a security vulnerability in Github.com/yuin/goldmark/renderer/html involving goldmark vulnerable to Cross-site Scripting (XSS) under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Github.com/yuin/goldmark/renderer/html versions are affected?
Affected versions include releases prior to 1.7.17 across affected packages: github.com/yuin/goldmark/renderer/html.
What version fixes CVE-2026-5160?
Upgrading to 1.7.17 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/yuin/goldmark/renderer/html affected?
Yes, github.com/yuin/goldmark/renderer/html is affected in releases prior to 1.7.17. Upgrade your dependency to 1.7.17 or later.
What is the CVSS score of CVE-2026-5160?
CVE-2026-5160 has a CVSS v3.1 base score of 6.1 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N.
What CWE is associated with CVE-2026-5160?
CVE-2026-5160 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (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.).
How can I check Go dependencies for CVE-2026-5160?
Run the dependency tree command: 'inspect dependencies for github.com/yuin/goldmark/renderer/html'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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&colon;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"
  }
}