All vulnerabilities

Servers and applications

GHSA-3gh5-7438-xc5j

Shortcode output bypasses Markdown HTML sanitizing in attributes and link destinations

Severity
Medium
Published
5 Dec 2026
Last changed
5 Dec 2026
Added to UpHeron
5 Dec 2026
Fixed in
0.171.1
Sources
Project advisories (GitHub)

Description

With markup.goldmark.renderer.unsafe set to false (the default), a content author could still inject javascript: URLs and event handler attributes by placing {{< >}} shortcodes inside link destinations, link titles or other attributes.

{{< >}} shortcodes are replaced with placeholder tokens before Markdown rendering, and the token is replaced with the shortcode output afterwards. Goldmark and render hooks only ever saw the token, so the dangerous URL check and attribute escaping were applied to it, not to the real output.

Fixed by HTML-escaping shortcode output that lands inside an HTML tag, and replacing dangerous URLs with #ZgotmplZ, when unsafe is false.

Stored XSS on sites that accept content from authors who should not be able to run script, with the default configuration and only the embedded shortcodes.

From gohugoio/hugo's security advisory.

Affected software

SoftwareAffected versions
HugoServers and applications · github:gohugoio/hugo
  • From 0.60.0 before 0.171.1

About Hugo

static site and RSS generator written in Go

From Wikidata, CC0 1.0.
Share of all websites
0.1%W3Techs, Nov 2026
GitHub stars
90,652GitHub, 6 Dec 2026
Forks
8,576GitHub, 6 Dec 2026
Latest release
v0.171.1GitHub, 6 Dec 2026
Released
5 Dec 2026GitHub
Developer
Bjorn Erik PedersenWikidata
License
Apache License 2.0Wikidata
Written in
GoWikidata
First released
2013Wikidata
First published on GitHub
4 Jul 2013GitHub

References