Hugo does not escape some attributes in internal templates
Published 9 Dec 2024 · Updated 10 Dec 2024
Is your project on an affected github.com/gohugoio/hugo?
Look after several Go apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie
Affected package
- Affected
- >=0.123.0 <0.139.4
- Fixed in
- 0.139.4
go get github.com/gohugoio/hugo@v0.139.4Details
Impact
Some HTML attributes in Markdown in the internal templates listed below not escaped. 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.htmlfromv0.123.0_default/_markup/render-image.htmlfromv0.123.0_default/_markup/render-table.htmlfromv0.134.0shortcodes/youtube.htmlfromv0.125.0
Patches
Patched in v0.139.4.
Workarounds
Replace with user defined templates or disable the internal templates: https://gohugo.io/getting-started/configuration-markup/#renderhooksimageenabledefault
References
- https://github.com/gohugoio/hugo/releases/tag/v0.139.4
- https://gohugo.io/about/security/
Is GHSA-c2xf-9v2r-r2rx in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected github.com/gohugoio/hugo, and gives you the command that fixes it.
More advisories for github.com/gohugoio/hugo
- LowCVE-2026-58403Hugo: Symlink confinement bypass in os.ReadFile in github.com/gohugoio/hugo · 24 Jul 2026
- LowCVE-2026-58402Hugo: XSS via unescaped code-fence language in default code block renderer in github.com/gohugoio/hugo · 24 Jul 2026
- LowCVE-2026-58404Hugo: security.http.urls deny rules bypassed by alternate IPv4 encodings (SSRF) in github.com/gohugoio/hugo · 24 Jul 2026
- LowCVE-2026-44301Hugo's Node tool execution allows file system access outside the project directory in github.com/gohugoio/hugo · 24 Jul 2026
- LowCVE-2026-50133Hugo: XSS via text/html content files in github.com/gohugoio/hugo · 7 Jul 2026
- LowCVE-2026-50135Hugo: Symlink confinement bypass in resources.Get in github.com/gohugoio/hugo · 7 Jul 2026
References
- Linkgithub.com/gohugoio/hugo/security/advisories/GHSA-c2xf-9v2r-r2rx
- Advisorynvd.nist.gov/vuln/detail/CVE-2024-55601
- Linkgithub.com/gohugoio/hugo/commit/54398f8d572c689f9785d59e907fd910a23401b0
- Packagegithub.com/gohugoio/hugo
- Linkgithub.com/gohugoio/hugo/releases/tag/v0.139.4
- Linkgohugo.io/getting-started/configuration-markup/#renderhooksimageenabledefault
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.