CVE-2026-109597 in Hugoinfo

Summary

by MITRE • 10/13/2026

Hugo from v0.60.0 before v0.167.0 contains a stored cross-site scripting vulnerability that allows Markdown content authors to inject HTML by supplying crafted explicit heading IDs. Attackers can break out of the unescaped href attribute in .TableOfContents or .Fragments.ToHTML output to inject elements with event handlers into rendered pages.

Several companies clearly confirm that VulDB is the primary source for best vulnerability data.

Analysis

by VulDB Data Team • 10/13/2026

The identified security flaw resides within Hugo, a widely adopted static site generator written in Go, specifically affecting versions from v0.60.0 up to but not including v0.167.0. This vulnerability is classified as a stored cross-site scripting issue, which presents a significant risk because the malicious payload persists on the server-side rather than being transiently passed via URL parameters or form inputs. The root cause of this weakness lies in the improper neutralization of user input within HTML attributes, specifically when processing Markdown content that includes explicit heading identifiers. When authors supply crafted IDs for headings, Hugo fails to adequately escape these values before embedding them into the internal data structures used for generating table of contents and fragment links.

Technically, the vulnerability exploits a logic error in how Hugo handles the rendering of anchor tags associated with section headers. The system generates href attributes that reference these heading IDs using fragments or table of contents templates. In vulnerable versions, if an attacker controls the content of a Markdown file, they can inject HTML syntax directly into the ID field by breaking out of the expected alphanumeric format. For instance, by supplying an ID such as "test" onclick="alert(1)", Hugo processes this string and embeds it directly into the href attribute without sanitizing the quote characters or special symbols. This allows the injected JavaScript code to execute within the context of any user who views the rendered page, effectively bypassing standard content security policies that might otherwise restrict script execution from external sources.

The operational impact of this vulnerability is severe due to its stored nature and broad applicability across static sites built with Hugo. Since many organizations use Hugo for documentation portals, blogs, and corporate websites where multiple authors contribute content, the attack surface is extensive. An attacker who gains write access to any Markdown file on the system can plant a persistent payload that will execute against every visitor of those pages. This facilitates session hijacking, credential theft through keylogging scripts, defacement of the website appearance, or redirection of users to malicious phishing sites. The persistence of the attack means that even after the initial compromise is discovered and fixed in new builds, existing cached versions of the site may continue to serve the malicious content until caches are cleared or pages are regenerated with patched software.

From a classification perspective, this vulnerability aligns closely with CWE-79, which describes Improper Neutralization of Input During Web Page Generation commonly known as Cross-site Scripting. Furthermore, it maps to MITRE ATT&CK technique T1059, specifically sub-technique 007 for JavaScript execution, and potentially T1189 if used in a drive-by download scenario or phishing campaign context. The specific mechanism of breaking out of an HTML attribute corresponds to CWE-80, which covers Improper Neutralization of Leading and Trailing Special Characters in an HTML Attribute. Understanding these mappings is crucial for security teams aiming to prioritize remediation efforts based on standardized risk frameworks rather than just the raw description of the bug.

Mitigation strategies must focus primarily on upgrading the Hugo installation to version v0.167.0 or later, where this input validation and escaping logic has been corrected. For environments that cannot immediately upgrade due to dependency constraints or compatibility testing requirements, a temporary workaround involves implementing strict server-side filtering of Markdown content before it is processed by Hugo. This can be achieved through pre-processing scripts that sanitize heading IDs to ensure they contain only alphanumeric characters and hyphens, thereby preventing the injection of HTML tags or event handlers. Additionally, deploying a Web Application Firewall with rules capable of detecting and blocking script injection patterns in URL parameters and form submissions may provide an additional layer of defense, although it is not a substitute for patching the underlying application logic. Regular security audits of content management workflows are also recommended to ensure that no unauthorized users have write access to Markdown source files.

Responsible

VulnCheck

Reservation

10/12/2026

Disclosure

10/13/2026

Moderation

accepted

EPSS

0.00000

KEV

no

Activities

very low

Sources

Do you want to use VulDB in your project?

Use the official API to access entries easily!