REDHAT-BUG-2497467: Medium severity Hugo Hugo vulnerability
Hugo is a static site generator. From 0.60.0 until 0.163.3, Hugo's default code-block renderer wrote the Markdown code-fence language or info-string into the code class="language-…" data-lang="…" wrapper without HTML escaping. A fence info-string containing a quote and a script payload breaks out of the attribute and injects a live script element. This issue is fixed in 0.163.3.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 0.163.3
Event History
Frequently Asked Questions
Who is exposed to this issue?
Sites generated with affected Hugo versions are exposed when they render Markdown content containing attacker-controlled code-fence info strings. The vulnerable default code-block renderer is involved.
What does an attacker need to exploit it?
An attacker needs a way to introduce a crafted Markdown code-fence info string into content that Hugo renders. The info string must contain a quote and script payload that escapes the generated HTML attribute.
Are default configurations affected?
Yes. The issue affects Hugo's default code-block renderer, which inserted the code-fence language or info string into HTML attributes without escaping it.
What versions are affected and what fixes the issue?
Hugo versions from 0.60.0 through 0.163.3 are identified as affected. The issue is fixed in version 0.163.3.