CVE-2026-50133
JSON

5.1medium

Hugo: XSS via text/html content files

Severity
5.1medium CVSS:4.0 by GitHub_M
Exploit likelihood
0.18% (higher than 8% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-c54g-xjwj-8g82GO-2026-5313

Description

Hugo is a static site generator. Prior to 0.162.0, 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 could therefore be served stored cross-site scripting. This vulnerability is fixed in 0.162.0.

Affected

Product or packageVersionsReported by
gohugoio hugo< 0.162.0CVE List
github.com/gohugoio/hugo (Go)before 0.162.0GitHub Advisory Database, Go Vulnerability Database
gohugo hugobefore 0.162.0NVD

All scores

GitHub_M5.1medium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
GitHubmedium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N
NVD6.1medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Classification

CWE-79

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

Hugo is a static site generator. Prior to 0.162.0, 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 could therefore be served stored cross-site scripting. This vulnerability is fixed in 0.162.0.

GitHub Advisory Database

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.

Go Vulnerability Database

Hugo: XSS via text/html content files in github.com/gohugoio/hugo

NVD (es)

Hugo es un generador de sitios estáticos. Antes de la versión 0.162.0, Hugo acepta archivos de contenido en varios formatos de marcado. Los archivos mapeados al tipo de medio text/html (típicamente archivos .html bajo /content, o páginas producidas por un adaptador de contenido que establece content.mediaType = ’text/html’) tenían su cuerpo emitido textualmente en la página renderizada. Un sitio que ingiere contenido HTML de una fuente no confiable podría, por lo tanto, servir cross-site scripting almacenado. Esta vulnerabilidad está corregida en la versión 0.162.0.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-50133 changed 2026-07-07CVE Terms of Use
GitHub Advisory DatabaseGHSA-c54g-xjwj-8g82 changed 2026-07-07CC-BY-4.0
Go Vulnerability DatabaseGO-2026-5313 changed 2026-07-07CC-BY-4.0
NVDCVE-2026-50133 changed 2026-10-25Public domain