CVE-2024-55601 Hugo does not escape some attributes in internal templates

Medium 5.3 Published Updated

Hugo fails to escape HTML attributes in internal templates, allowing attackers to inject scripts via Markdown content.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2024-55601?

CVE-2024-55601 is a medium-severity cross-site scripting vulnerability in gohugoio hugo, published on 9 Dec 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

Official description

Hugo is a static site generator. Starting in version 0.123.0 and prior to version 0.139.4, some HTML attributes in Markdown in the internal templates listed below not escaped in internal render hooks. Those whoa re impacted are Hugo users who do not trust their Markdown content files and are using one or more of these templates: `_default/_markup/render-link.html` from `v0.123.0`; `_default/_markup/render-image.html` from `v0.123.0`; `_default/_markup/render-table.html` from `v0.134.0`; and/or `shortcodes/youtube.html` from `v0.125.0`. This issue is patched in v0.139.4. As a workaround, one may replace an affected component with user defined templates or disable the internal templates.

Weakness: CWE-79

Which versions are affected by CVE-2024-55601?

3 open source packages ship an affected version, including github.com/gohugoio/hugo.

PackageAffectedFixed in
github.com/gohugoio/hugo GoFrom 0.123.00.139.4
github.com/gohugoio/hugo GoFrom 0.123.00.139.4
github.com/gohugoio/hugo GoFrom 0.123.00.139.4

How do I fix CVE-2024-55601?

Upgrade github.com/gohugoio/hugo to 0.139.4 or later.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2024-55601 being exploited?

There is no known exploitation of CVE-2024-55601 in the wild and no public exploit code.

Sources

Also known as DEBIAN-CVE-2024-55601, GHSA-c2xf-9v2r-r2rx, GO-2024-3314, UBUNTU-CVE-2024-55601.

Is CVE-2024-55601 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free