CVE-2024-32875 Hugo doesn't escape markdown title in internal render hooks
Attackers can inject malicious scripts via unescaped Markdown titles in Hugo internal render hooks, affecting users with trusted content disabled.
- 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-32875?
CVE-2024-32875 is a medium-severity cross-site scripting vulnerability in gohugoio hugo, published on 23 Apr 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.125.3, title arguments in Markdown for links and images not escaped in internal render hooks. Hugo users who are impacted are those who have these hooks enabled and do not trust their Markdown content files. The issue is patched in v0.125.3. As a workaround, replace the templates with user defined templates or disable the internal templates.
Which versions are affected by CVE-2024-32875?
3 open source packages ship an affected version, including github.com/gohugoio/hugo.
| Package | Affected | Fixed in |
|---|---|---|
github.com/gohugoio/hugo Go | From 0.123.0 | 0.125.3 |
github.com/gohugoio/hugo Go | From 0.123.0 | 0.125.3 |
github.com/gohugoio/hugo Go | From 0.123.0 | 0.125.3 |
How do I fix CVE-2024-32875?
Upgrade github.com/gohugoio/hugo to 0.125.3 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-32875 being exploited?
There is no known exploitation of CVE-2024-32875 in the wild and no public exploit code.
Sources
Also known as DEBIAN-CVE-2024-32875, GHSA-ppf8-hhpp-f5hj, GO-2024-2747, UBUNTU-CVE-2024-32875.