All vulnerabilities

Servers and applications

GHSA-wcpj-vcvm-j4pg

Stored XSS via unescaped heading ID in Table of Contents HTML

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

Description

Explicit heading IDs in Markdown (e.g. ## Intro {id="..."}) were written unescaped into the href of the generated Table of Contents HTML. A content author who controls Markdown can break out of the attribute and inject arbitrary HTML, including elements with event handlers, into any page that renders .TableOfContents or .Fragments.ToHTML.

This affects sites that build untrusted or third-party Markdown content and render a table of contents. The heading element itself was already escaped; only the ToC output was affected.

From gohugoio/hugo's security advisory.

Workarounds

Do not render .TableOfContents or .Fragments.ToHTML for untrusted content, or validate heading IDs in a content pipeline before building.

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

Affected software

SoftwareAffected versions
HugoServers and applications · github:gohugoio/hugo
  • From 0.60.0 before 0.167.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