CVE-2026-50133: Hugo: XSS via text/html content files
Commit: e41a06447d — Disallow HTML content by default Affected versions: all Hugo versions prior to v0.162.0. Fixed in: v0.162.0. Severity: Low to Medium, depending on threat model. Not an issue if you fully trust every file under /content and every content adapter you load. Description. Hugo accepts content files in several markup formats.
Published Jun 16, 2026
Affected packages
github.com/gohugoio/hugo
- Ecosystem
- Go
- Affected
- < 0.162.0
- Fixed in
- 0.162.0
- Check
go list -m github.com/gohugoio/hugo
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Commit: e41a06447d — _Disallow HTML content by default_ Affected versions: all Hugo versions prior to v0.162.0. Fixed in: v0.162.0. Severity: Low to Medium, depending on threat model. Not an issue if you fully trust every file under /content and every content adapter you load.
Description. Hugo accepts content files in several markup formats. Files mapped to the text/html media type (typically .html files under /content, or pages produced by a content adapter that sets content.mediaType = "text/html") had their body emitted verbatim into the rendered page. A site that ingests HTML content from an untrusted source — for example, a CMS-backed editor, a content adapter pulling from an external API, or an automated import pipeline — could therefore be served stored cross-site scripting.
Mitigation. v0.162.0 introduces a security.allowContent whitelist with text/html denied by default. Sites that intentionally author HTML content can opt back in:
[security]
allowContent = ['.*']This only affects pages whose source file (or content adapter output) declares an HTML media type; Markdown, AsciiDoc, Org, Pandoc and reStructuredText content is unaffected.
Credited to jmooring.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Go vulnerabilities
All Go entriesGHSA-c3wq-j5vh-68rc
Hugo: Symlink confinement bypass in os.ReadFile
medium6.0Jun 19, 2026GHSA-q76j-gcg9-vxc6
Hugo: XSS via unescaped code-fence language in default code block renderer
medium5.1Jun 19, 2026GHSA-r46f-3rpw-hxrv
Hugo: security.http.urls deny rules bypassed by alternate IPv4 encodings (SSRF)
high7.7Jun 19, 2026CVE-2026-50134
Hugo: security.http.urls allow-list bypass via HTTP redirects
mediumJun 16, 2026CVE-2026-50135
Hugo: Symlink confinement bypass in resources.Get
medium6.9Jun 16, 2026CVE-2026-44301
Hugo's Node tool execution allows file system access outside the project directory
medium6.2May 6, 2026
