All vulnerabilities

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.

From gohugoio/hugo's security advisory. Shortened; the full text is there.

Affected software

SoftwareAffected versions
HugoServers and applications · github:gohugoio/hugo
  • From 0.123.5 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