CVE-2026-50133: Hugo Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-c54g-xjwj-8g82
CWE-79
Published
Advisory Summary

CVE-2026-50133 is a MODERATE cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Hugo libraries in the Go ecosystem. The issue involves xss via text/html content files. Remediation is available by upgrading affected packages to version 0.162.0.

CVE-2026-50133 at a Glance

CVE Identifier CVE-2026-50133
GHSA Identifier GHSA-c54g-xjwj-8g82
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Hugo
Package Ecosystem Go
Published Date
Last Updated

How to Fix CVE-2026-50133

To remediate this vulnerability, upgrade all affected Hugo dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/gohugoio/hugo fixed: 0.162.0
Upgrade github.com/gohugoio/hugo to 0.162.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/gohugoio/hugo

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-50133, inspect your project dependencies for Hugo:

inspect dependencies for github.com/gohugoio/hugo

Analyze the terminal output to locate any version of Hugo in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.162.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Hugo, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

**Commit:** [e41a06447d](https://github.com/gohugoio/hugo/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: ```toml [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.

CVE-2026-50133 Affected Hugo Versions

1 component(s)
Fixed Versions:
0.162.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/gohugoio/hugo
Go
< 0.162.0
0.162.0

References

Frequently Asked Questions

What is CVE-2026-50133?
CVE-2026-50133 is a security vulnerability in Hugo involving XSS via text/html content files under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Hugo versions are affected?
Affected versions include releases prior to 0.162.0 across affected packages: github.com/gohugoio/hugo.
What version fixes CVE-2026-50133?
Upgrading to 0.162.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/gohugoio/hugo affected?
Yes, github.com/gohugoio/hugo is affected in releases prior to 0.162.0. Upgrade your dependency to 0.162.0 or later.
What CWE is associated with CVE-2026-50133?
CVE-2026-50133 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check Go dependencies for CVE-2026-50133?
Run the dependency tree command: 'inspect dependencies for github.com/gohugoio/hugo'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-c54g-xjwj-8g82",
  "modified" : "2026-06-16T19:22:14Z",
  "published" : "2026-06-16T19:22:14Z",
  "aliases" : [ "CVE-2026-50133" ],
  "summary" : "Hugo: XSS via text/html content files",
  "details" : "**Commit:** [e41a06447d](https://github.com/gohugoio/hugo/commit/e41a06447d) — _Disallow HTML content by default_\n**Affected versions:** all Hugo versions prior to v0.162.0.\n**Fixed in:** v0.162.0.\n**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.\n\n**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.\n\n**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:\n\n```toml\n[security]\nallowContent = ['.*']\n```\n\nThis only affects pages whose source file (or content adapter output) declares an HTML media type; Markdown, AsciiDoc, Org, Pandoc and reStructuredText content is unaffected.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/gohugoio/hugo"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.162.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/gohugoio/hugo/security/advisories/GHSA-c54g-xjwj-8g82"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gohugoio/hugo/commit/e41a06447daa3071a01f333fdcec0a5153c3c8d1"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/gohugoio/hugo"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/gohugoio/hugo/releases/tag/v0.162.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-16T19:22:14Z",
    "nvd_published_at" : null
  }
}