All vulnerabilities

Servers and applications

GHSA-q4xf-287f-98r8

Stored XSS via unescaped lineAnchors code block option

Severity
Medium
Published
9 Sept 2026
Last changed
9 Sept 2026
Added to UpHeron
3 Nov 2026
Fixed in
0.166.0
Sources
Project advisories (GitHub)

Description

Hugo's syntax highlighter did not escape the lineAnchors option before passing it to Chroma, which writes the value verbatim into the id and href attributes of the generated line number markup. A lineAnchors value supplied as a code fence attribute in Markdown content, e.g.

func main() {}

resulted in unescaped HTML in the rendered page. This is a stored cross-site scripting (XSS) vulnerability for sites that build and publish Markdown from untrusted contributors.

The highlight template function is affected in the same way when given an untrusted lineAnchors option.

From gohugoio/hugo's security advisory.

Workarounds

None. If you cannot upgrade, do not build Markdown from untrusted sources.

Workarounds as given by gohugoio/hugo's security advisory.

Affected software

SoftwareAffected versions
HugoServers and applications · github:gohugoio/hugo
  • From 0.75.0 before 0.166.0

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,472GitHub, 15 Nov 2026
Forks
8,450GitHub, 15 Nov 2026
Latest release
v0.170.0GitHub, 15 Nov 2026
Released
13 Nov 2026GitHub
Developer
Bjorn Erik PedersenWikidata
License
Apache Software License 2.0Wikidata
Written in
GoWikidata
First released
2013Wikidata
First published on GitHub
4 Jul 2013GitHub

References