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.
Affected software
| Software | Affected versions |
|---|---|
HugoServers and applications · github:gohugoio/hugo |
|
About Hugo
static site and RSS generator written in Go
- 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
Vulnerabilities in Hugo
- In our list
- 34
- Published in the last 12 months
- 31
- Critical, last 12 months
- 0
- High, last 12 months
- 1
- Known exploited
- 0
- GHSA-xh5j-xxg7-fjqmThemes can read and write files outside of themselves via symlinks and absolute pathsMedium 5 Dec 2026
- GHSA-3pjw-44j4-52g6Include-only mount file filters can be bypassed by direct file lookupsLow 5 Dec 2026
- CVE-2026-140394Hugo 0.141.0 before 0.170.0 Stored XSS via highlight shortcode wrapperClassMedium 5.1 1 Dec 2026
- CVE-2026-140395Hugo 0.56.0 before 0.170.0 Path Traversal via _vendor/modules.txtHigh 8.7 1 Dec 2026
- GHSA-4whp-jx7j-xvrmHugo highlight wrapperClass option allows stored cross-site scriptingMedium 13 Nov 2026
- GHSA-r48v-r4vw-h9v8Hugo: Build-host file disclosure through path traversal in vendored module metadataMedium 13 Nov 2026
References
- GitHub Advisory Database https://github.com/advisories/GHSA-3gh5-7438-xc5j
- github.com https://github.com/gohugoio/hugo/security/advisories/GHSA-3gh5-7438-xc5j