All vulnerabilities

Servers and applications

GHSA-r4xx-89rf-5424

js.Build allowed themes to read files outside the project via ESBuild's fallback resolver

Severity
Medium
Published
28 Sept 2026
Last changed
28 Sept 2026
Added to UpHeron
3 Nov 2026
Fixed in
0.167.0
Sources
Project advisories (GitHub)

Description

Hugo's security model states that only the main project, not external components such as themes, can access files outside the project root. js.Build, js.Batch and css.Build hand imports that are not found in /assets over to ESBuild's own resolver, which reads directly from the file system with no notion of the project root and follows symlinks. A theme could ship a JavaScript file with import secret from "../secret.txt", or a symlink pointing outside the project, and have the file content bundled into the published site.

A malicious theme or Hugo module can read any file readable by the build user and publish it as part of the site's JavaScript or CSS output. No user interaction beyond using the theme and running a build is required.

From gohugoio/hugo's security advisory.

Workarounds

Do not use themes or modules you do not trust. Review imports in js.Build, js.Batch and css.Build entry points for paths that leave the project.

Workarounds as given by gohugoio/hugo's security advisory.

Affected software

SoftwareAffected versions
HugoServers and applications · github:gohugoio/hugo
  • From 0.84.0 before 0.167.0

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,472GitHub, 15 Nov 2026
Forks
8,450GitHub, 15 Nov 2026
Latest release
v0.170.0GitHub, 15 Nov 2026
Released
13 Nov 2026GitHub
Developer
Bjorn Erik PedersenWikidata
License
Apache Software License 2.0Wikidata
Written in
GoWikidata
First released
2013Wikidata
First published on GitHub
4 Jul 2013GitHub

References