github.com/gohugoio/hugo is vulnerable to Improper Link Resolution Before File Access ('Link Following')
50
CVE Score
Medium
Improper Link Resolution Before File Access ('Link Following')
Hugo's hugofs.RootMappingFs.collectDirEntries() enumerates intermediate "virtual ancestor" directories of a nested module/theme mount by calling JoinStat() on the parent mount and, when successful, directly invoking collectDir() without applying the symlink-confinement check that the sibling direct-file-access path (statRoot) already enforced starting at v0.162.0. A theme or module mounted by the site build supplies the ancestor directory path; if that ancestor is a symlink or NTFS junction pointing outside the module root, its target directory's files are listed and their contents become readable and can be published via resources.Match and similar resource functions during the build. The fix adds a call to isSymlinkOrHasSymlinkParent(rfs.Fs, rm.To, fi.Meta().Filename) before collecting the ancestor directory, skipping it (via continue) when it is a symlink or has a symlinked parent, mirroring the existing confinement rule used for direct file access.
Upgrade the github.com/gohugoio/hugo package to version 0.167.0 or later.
You are affected if you use a Hugo version in the vulnerable range and build a site with nested module or theme mounts where a symlink or junction at an intermediate mount ancestor points outside the mount root.
0.162.0 - 0.166.0
Fixed in 0.167.0github.com/gohugoio/hugo is vulnerable to Improper Link Resolution Before File Access ('Link Following') in versions 0.162.0 - 0.166.0.
Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.
No credit card required | Scan results in 32 seconds.
I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.