Servers and applications
GHSA-3pjw-44j4-52g6
Include-only mount file filters can be bypassed by direct file lookups
- Severity
- Low
- 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 mount files (or includeFiles) filter with include patterns could expose files it was meant to exclude, when those files were looked up by exact path.
For each include pattern, Hugo also adds patterns for the pattern's parent directories, so that directory walking works. Those directory patterns should only match directories. On a direct lookup, RootMappingFs.statRoot called InclusionFilter.Match(name, true), telling the filter the path was a directory before checking what it actually was. A regular file whose path matched one of those directory patterns was therefore included.
For example, files = ["/images//.png"] adds the directory pattern /images/*, which also matches the file /images/secret.key.
Fixed by looking up the file first and passing the real fi.IsDir() to the filter.
Files excluded by a mount's include-only filter can be read and published. Exploiting this needs a content file or template that references the excluded file's exact path.
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-xh5j-xxg7-fjqmThemes can read and write files outside of themselves via symlinks and absolute pathsMedium 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-3pjw-44j4-52g6
- github.com https://github.com/gohugoio/hugo/security/advisories/GHSA-3pjw-44j4-52g6