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).
Affected software
| Software | Affected versions |
|---|---|
HugoServers and applications · github:gohugoio/hugo |
|
About Hugo
static site and RSS generator written in Go
- 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
Vulnerabilities in Hugo
- In our list
- 34
- Published in the last 12 months
- 31
- Critical, last 12 months
- 0
- High, last 12 months
- 1
- Known exploited
- 0
- GHSA-3gh5-7438-xc5jShortcode output bypasses Markdown HTML sanitizing in attributes and link destinationsMedium 5 Dec 2026
- GHSA-3pjw-44j4-52g6Include-only mount file filters can be bypassed by direct file lookupsLow 5 Dec 2026
- CVE-2026-140394Hugo 0.141.0 before 0.170.0 Stored XSS via highlight shortcode wrapperClassMedium 5.1 1 Dec 2026
- CVE-2026-140395Hugo 0.56.0 before 0.170.0 Path Traversal via _vendor/modules.txtHigh 8.7 1 Dec 2026
- GHSA-4whp-jx7j-xvrmHugo highlight wrapperClass option allows stored cross-site scriptingMedium 13 Nov 2026
- GHSA-r48v-r4vw-h9v8Hugo: Build-host file disclosure through path traversal in vendored module metadataMedium 13 Nov 2026
References
- GitHub Advisory Database https://github.com/advisories/GHSA-xh5j-xxg7-fjqm
- github.com https://github.com/gohugoio/hugo/security/advisories/GHSA-xh5j-xxg7-fjqm