All vulnerabilities

Servers and applications

GHSA-xh5j-xxg7-fjqm

Themes can read and write files outside of themselves via symlinks and absolute paths

Severity
Medium
Published
5 Dec 2026
Last changed
5 Dec 2026
Added to UpHeron
5 Dec 2026
Fixed in
0.171.1
Sources
Project advisories (GitHub)

Description

A malicious theme or module could make Hugo read files from outside the theme and publish them, or create files outside the project.

Hugo's security model treats themes and modules as untrusted when it comes to filesystem access: they should not reach outside their own directory. Several code paths did not enforce this:

  • The theme's resources cache dir was mounted without symlink filtering, so a symlinked cache entry (e.g. a processed image) was served from anywhere on disk.
  • Theme config (hugo.toml, config/) was loaded through symlinks.
  • package.json workspaces with absolute paths were mounted as-is.
  • hugo mod vendor followed symlinks and copied their targets into _vendor.
  • A missing hugo_stats.json mount source was created through a symlink, possibly outside the project.
  • os.ReadFile, os.ReadDir and os.Stat checked containment with a string prefix, so ../mysite-backup/ passed for project dir mysite (fixed in afero v1.16.0).
From gohugoio/hugo's security advisory. Shortened; the full text is there.

Affected software

SoftwareAffected versions
HugoServers and applications · github:gohugoio/hugo
  • From 0.56.0 before 0.171.1

About Hugo

static site and RSS generator written in Go

From Wikidata, CC0 1.0.
Share of all websites
0.1%W3Techs, Nov 2026
GitHub stars
90,652GitHub, 6 Dec 2026
Forks
8,576GitHub, 6 Dec 2026
Latest release
v0.171.1GitHub, 6 Dec 2026
Released
5 Dec 2026GitHub
Developer
Bjorn Erik PedersenWikidata
License
Apache License 2.0Wikidata
Written in
GoWikidata
First released
2013Wikidata
First published on GitHub
4 Jul 2013GitHub

References