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 package | Versions | Reported by |
|---|---|---|
| gohugoio hugo | < 0.162.0 | CVE List |
| github.com/gohugoio/hugo (Go) | before 0.162.0 | GitHub Advisory Database, Go Vulnerability Database |
| gohugo hugo | before 0.162.0 | NVD |
All scores
| GitHub_M | 5.1medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N |
| GitHub | medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N |
| NVD | 6.1medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
Classification
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
| https://github.com/gohugoio/hugo/security/advisories/GHSA-c54g-xjwj-8g82 | advisory, vendor-advisory, web | |
| https://github.com/gohugoio/hugo/commit/e41a06447daa3071a01f333fdcec0a5153c3c8d1 | fix, patch, web | |
| https://github.com/gohugoio/hugo/releases/tag/v0.162.0 | release-notes, web | |
| https://github.com/gohugoio/hugo | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-50133 changed 2026-07-07 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-c54g-xjwj-8g82 changed 2026-07-07 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2026-5313 changed 2026-07-07 | CC-BY-4.0 |
| NVD | CVE-2026-50133 changed 2026-10-25 | Public domain |