CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-R73Q-GWX2-FPXM

GHSA-r73q-gwx2-fpxm: Arbitrary Host Directory Mount and Sandbox Bypass via Theme Module Replacements in Hugo

Amit Schendel
Amit Schendel
Senior Security Researcher

Nov 30, 2026·10 min read·2 visits

Executive Summary (TL;DR)

A flaw in Hugo's module configuration parser allows untrusted themes to define module.replacements when the root project leaves them unset. This marks theme imports as trusted project replacements, bypassing directory traversal checks (CWE-22) and allowing arbitrary host paths to be mounted into the site build and Node.js asset pipeline. Upgrade to Hugo v0.168.0 to remediate.

Hugo versions 0.152.0 through 0.167.x contain a path traversal and sandbox bypass vulnerability in the module configuration loader. When a root project does not define module replacements, Hugo permits imported themes or modules to define their own module.replacements directives. Because replaced module imports are internally marked as project-replaced, they bypass theme directory path restrictions, allowing an untrusted theme to mount arbitrary host filesystem directories and expand the Node.js read sandbox.

Vulnerability Overview

Hugo (github.com/gohugoio/hugo) is a static site generator written in Go that supports modular site architectures through Hugo Modules and third-party themes. To safely process untrusted third-party themes, Hugo implements a virtual file system (hugofs) and enforces strict directory sandboxing. While the root project configuration (hugo.toml) is granted elevated trust to mount arbitrary directories on the host file system, imported themes and modules are restricted to mounting files strictly within their designated theme subdirectory.

In Hugo versions starting from v0.152.0 and prior to v0.168.0, an architectural flaw in the module configuration decoding logic allows third-party themes to bypass this directory containment policy. Specifically, the applyThemeConfig function in modules/collect.go fails to isolate the module.replacements configuration setting between the root project and child themes when the root project does not explicitly configure any module replacements.

This flaw is classified under CWE-22 (Improper Limitation of a Pathname to a Restricted Directory) and CWE-552 (Files or Directories Accessible to External Parties). When a theme supplies its own module.replacements entry, Hugo applies the replacement mapping and flags the resulting module import as a trusted project-level replacement (pathProjectReplaced = true).

Consequently, the path validation routine createThemeDirname disables both absolute path rejection and relative path traversal (../) validation. An attacker supplying a malicious theme can mount arbitrary directories from the host operating system into the Hugo virtual file system. Furthermore, mounting external host directories under the assets target automatically expands the --allow-fs-read permission boundary for Node.js subprocesses, exposing sensitive host files to external asset processors such as PostCSS.

Root Cause Analysis

The root cause of GHSA-r73q-gwx2-fpxm resides in how Hugo propagates the project-level replacementsMap during theme initialization and how downstream path resolution interprets replaced module flags. In Hugo's module system, module.replacements is intended strictly as a root project directive used during local development to redirect remote module paths to local file system paths.

When Hugo initializes a site build, it first decodes the primary project's module configuration and stores any path replacement mappings in c.moduleConfig.replacementsMap. If the primary project does not define a replacements key in its [module] configuration block, c.moduleConfig.replacementsMap remains nil. Subsequently, when Hugo loads imported themes or component modules, the collector invokes applyThemeConfig in modules/collect.go, passing c.moduleConfig.replacementsMap directly to decodeConfig (modules/config.go).

Inside decodeConfig, the function assigns the passed pathReplacements parameter to c.replacementsMap and then uses mapstructure.WeakDecode to unmarshal the theme's own [module] configuration block into the Config struct c. Immediately following this decode operation, decodeConfig checks if c.replacementsMap == nil. Because the root project left this map uninitialized (nil), decodeConfig assumes it is parsing a root configuration and proceeds to parse c.Replacements—which was just populated from the untrusted theme's configuration file.

Once the theme's replacement strings (old_path -> new_path) are compiled into c.replacementsMap, decodeConfig iterates over the theme's c.Imports slice. For every import path matching a key in c.replacementsMap, Hugo overwrites imp.Path with the replacement target and sets the internal boolean flag imp.pathProjectReplaced = true. This flag signals to the rest of the module loader that the root project explicitly authorized a local path override.

When getAndCreateModule (modules/collect.go) later resolves the filesystem location for the module via createThemeDirname(modulePath, owner.projectMod || moduleImport.pathProjectReplaced), the second parameter (isProjectMod) evaluates to true. Inside createThemeDirname (modules/client.go), an isProjectMod == true state grants two exemptions:

  1. If filepath.IsAbs(modulePath) is true, the function immediately returns the raw absolute path rather than returning an error.
  2. When resolving relative paths via filepath.Join(c.ccfg.ThemesDir, modulePath), the prefix check !strings.HasPrefix(moduleDir, c.ccfg.ThemesDir) is short-circuited by !isProjectMod, allowing ../ sequences to traverse arbitrarily far above the themesDir root.

Code Analysis

Examining the interaction between modules/config.go, modules/client.go, and the patched modules/collect.go illustrates how the state confusion occurs and how the upstream patch prevents it.

In modules/config.go, decodeConfig handles both project-level and theme-level configurations. The distinction between the two relies on the pathReplacements map passed by the caller:

func decodeConfig(logger logg.Logger, cfg config.Provider, pathReplacements map[string]string) (Config, error) {
    c := DefaultModuleConfig
    c.replacementsMap = pathReplacements
    // ...
    if moduleSet {
        m := cfg.GetStringMap("module")
        if err := mapstructure.WeakDecode(m, &c); err != nil {
            return c, err
        }
 
        // FLAW: When pathReplacements is nil (because the root project declared none),
        // c.Replacements decoded from a theme's cfg is processed here.
        if c.replacementsMap == nil {
            if len(c.Replacements) == 1 {
                c.Replacements = strings.Split(c.Replacements[0], ",")
            }
            // ... parses theme's c.Replacements into c.replacementsMap ...
        }
 
        if c.replacementsMap != nil && c.Imports != nil {
            for i, imp := range c.Imports {
                if newImp, found := c.replacementsMap[imp.Path]; found {
                    imp.Path = newImp
                    // Marks the theme import as replaced by the root project
                    imp.pathProjectReplaced = true
                    c.Imports[i] = imp
                }
            }
        }
    }

When the module collector resolves the physical directory of an imported non-Go module in modules/client.go, createThemeDirname relies entirely on isProjectMod (which receives owner.projectMod || moduleImport.pathProjectReplaced) to enforce containment within c.ccfg.ThemesDir:

func (c *Client) createThemeDirname(modulePath string, isProjectMod bool) (string, error) {
    invalid := fmt.Errorf("invalid module path %q; must be relative to themesDir when defined outside of the project", modulePath)
 
    modulePath = filepath.Clean(modulePath)
    if filepath.IsAbs(modulePath) {
        if isProjectMod {
            return modulePath, nil // Exemption 1: Absolute host paths allowed
        }
        return "", invalid
    }
 
    moduleDir := filepath.Join(c.ccfg.ThemesDir, modulePath)
    if !isProjectMod && !strings.HasPrefix(moduleDir, c.ccfg.ThemesDir) {
        return "", invalid // Exemption 2: Directory traversal check skipped when isProjectMod == true
    }
    return moduleDir, nil
}

The official patch in commit 6883b55ad59e0daa1aaba0cf2b66db1132202e2c modifies applyThemeConfig in modules/collect.go so that a non-nil replacements map is always passed to decodeConfig when processing theme configurations:

diff --git a/modules/collect.go b/modules/collect.go
index 5680f065c01..04d9c19ad79 100644
--- a/modules/collect.go
+++ b/modules/collect.go
@@ -527,7 +527,12 @@ LOOP:
 		}
 	}
 
-	config, err := decodeConfig(c.logger.Logger(), tc.cfg, c.moduleConfig.replacementsMap)
+	// Only the project can define replacements.
+	replacements := c.moduleConfig.replacementsMap
+	if replacements == nil {
+		replacements = map[string]string{}
+	}
+	config, err := decodeConfig(c.logger.Logger(), tc.cfg, replacements)
 	if err != nil {
 		return err
 	}

> [!NOTE] > Assessment of Fix Completeness: In Go, an initialized empty map (map[string]string{}) is distinct from an uninitialized nil map (replacements == nil evaluates to false). By substituting a non-nil empty map whenever c.moduleConfig.replacementsMap is nil, the if c.replacementsMap == nil branch inside decodeConfig is unconditionally skipped for all theme and component module configurations. While mapstructure.WeakDecode still populates the c.Replacements slice on the struct, that slice is never converted into c.replacementsMap entries, and imp.pathProjectReplaced can no longer be triggered by a theme. The fix completely neutralizes this code path.

Exploitation Methodology

Exploiting GHSA-r73q-gwx2-fpxm requires a developer or automated CI/CD pipeline to run a Hugo site build (hugo or hugo server) using an untrusted or compromised theme when the top-level project configuration does not declare its own module.replacements. No special command-line flags or elevated OS privileges are required.

To construct an exploit payload, the attacker creates a theme configuration file (themes/mytheme/hugo.toml) that defines a synthetic module name in module.imports and redirects that name to a sensitive host directory using module.replacements. The theme then mounts the root of that replaced module (source = ".") into Hugo's assets virtual directory.

Consider the following directory hierarchy and configuration files based on the upstream regression test:

# Root project configuration: hugo.toml
disableKinds = ["taxonomy", "term", "rss"]
theme = "mytheme"
# Malicious theme configuration: themes/mytheme/hugo.toml
[module]
replacements = "evil -> ../../secret"
 
[[module.imports]]
path = "evil"
 
[[module.imports.mounts]]
source = "."
target = "assets"

When the victim runs hugo, the following execution sequence occurs:

  1. Hugo parses the root hugo.toml. Because no [module] replacements exist, c.moduleConfig.replacementsMap remains nil.
  2. Hugo loads themes/mytheme/hugo.toml via applyThemeConfig. The replacements = "evil -> ../../secret" directive is parsed and applied to the evil module import, setting pathProjectReplaced = true.
  3. createThemeDirname resolves ../../secret relative to themes/ (or an absolute path such as /etc), bypassing directory containment checks because isProjectMod is true.
  4. During mount normalization (normalizeMounts), the mount source = "." passes filepath.IsLocal(".") validation because it is relative to the newly established module root (../../secret).
  5. The target host directory is mounted directly into Hugo's assets virtual filesystem.

Once mounted into assets, the attacker can exfiltrate file contents through two primary mechanisms. First, Hugo templates within the theme can invoke resources.Get or resources.Match to read arbitrary files from the mounted directory and embed their contents straight into the generated HTML output inside public/.

Second, mounting a host directory into assets alters Hugo's Node.js security boundary. Hugo populates the --allow-fs-read flag for Node.js subprocesses (security.node.permissions) using all active assets mount roots. By mounting an external directory into assets, the attacker expands the Node.js filesystem sandbox to include that host directory, enabling asset pipeline plugins (such as css.PostCSS) to read sensitive host files or load and execute arbitrary JavaScript modules residing in the mounted path.

Impact Assessment

The primary security impact of GHSA-r73q-gwx2-fpxm is high confidentiality loss on the system executing the Hugo build (VC:H under CVSS v4.0), accompanied by a sandbox escape in environments leveraging Node.js asset pipelines. The official CVSS v4.0 vector is CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N, resulting in a base score of 6.8 (Medium).

In a typical exploitation scenario targeting an automated deployment pipeline (such as GitHub Actions, GitLab CI, or Netlify), a malicious theme update or pull request can mount sensitive directories from the build runner—such as /etc, /proc/self/environ, ~/.aws, or ~/.ssh—into the Hugo assets directory. The theme's layout templates can then read these files via resources.Get and render the extracted secrets directly into the publicly deployed static website.

For local developer workstations, running hugo or hugo server on a project utilizing a malicious theme exposes any file readable by the user's OS account. Furthermore, if the project invokes Node-based asset processors like PostCSS or Tailwind CSS, expanding the --allow-fs-read boundary allows Node.js scripts to access files and import .js modules outside the project root, negating Hugo's built-in Node permission restrictions.

Integrity (VI:N) and Availability (VA:N) impacts are rated as None within the scope of Hugo's native virtual file system because hugofs mounts used for assets are read-only interfaces; Hugo does not write back to mounted assets source directories during site generation.

Remediation & Mitigation

The definitive remediation for GHSA-r73q-gwx2-fpxm is to upgrade Hugo to version v0.168.0 or later. In v0.168.0, theme-level module.replacements directives are unconditionally ignored, and any attempt by a theme to import a virtual module name relying on theme-level replacement fails the build with module "<name>" not found.

# Upgrade Hugo using Go install
go install github.com/gohugoio/hugo@v0.168.0

For environments where an immediate upgrade of the Hugo binary is not feasible, security engineers and site administrators can apply a configuration-level workaround that neutralizes the vulnerable code branch in decodeConfig. Because the vulnerability only triggers when the root project's c.moduleConfig.replacementsMap is nil, explicitly defining a dummy module.replacements entry in the root project's hugo.toml initializes replacementsMap and prevents Hugo from parsing replacements defined in child themes:

# Workaround in root project hugo.toml for Hugo >= 0.152.0, < 0.168.0
[module]
replacements = "_dummy_nonexistent_module -> _dummy_nonexistent_target"

In addition to patching or applying the configuration workaround, teams should audit existing third-party themes and vendored modules in their repositories for unauthorized replacements directives:

# Search for module replacement directives across themes and vendored modules
grep -rn "replacements" themes/ _vendor/

Finally, CI/CD pipelines building Hugo sites that incorporate third-party themes should run within isolated, ephemeral containers without host volume mounts or ambient cloud credential files on the filesystem.

Official Patches

gohugoioOfficial fix commit ignoring module.replacements in theme configurations
gohugoioHugo v0.168.0 release containing the patch

Fix Analysis (1)

Technical Appendix

CVSS Score
6.8/ 10
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N

Affected Systems

github.com/gohugoio/hugo (>= 0.152.0, < 0.168.0)

Affected Versions Detail

Product
Affected Versions
Fixed Version
Hugo
gohugoio
>= 0.152.0, < 0.168.00.168.0
AttributeDetail
Advisory IDGHSA-r73q-gwx2-fpxm
Weakness ClassCWE-22 (Path Traversal) / CWE-552
CVSS v4.0 Score6.8 Medium (CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N)
Attack VectorLocal / Build-time via Untrusted Hugo Theme or Module
Affected Versions>= 0.152.0, < 0.168.0
Patched Versionv0.168.0
Primary ImpactArbitrary Host Directory Mount & Node.js Read Sandbox Escape
Exploit StatusProof-of-Concept (Regression Test in Upstream Patch)

MITRE ATT&CK Mapping

T1083File and Directory Discovery
Discovery
T1005Data from Local System
Collection
T1059.007Command and Scripting Interpreter: JavaScript
Execution
CWE-22
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.

Known Exploits & Detection

GitHub Security AdvisoryOfficial security advisory detailing the theme module.replacements sandbox bypass and Node.js read permission expansion.
GitHub Commit (Regression Test PoC)Upstream fix commit containing TestMountRestrictThemeReplacements in hugofs/hugofs_integration_test.go demonstrating the exploit configuration.

Vulnerability Timeline

Patch committed upstream (6883b55ad59e0daa1aaba0cf2b66db1132202e2c) via PR #15426
2026-10-09
GitHub Security Advisory GHSA-r73q-gwx2-fpxm published and fixed in Hugo v0.168.0
2026-11-30

References & Sources

  • [1]GitHub Security Advisory: GHSA-r73q-gwx2-fpxm
  • [2]Upstream Pull Request #15426
  • [3]Official Fix Commit: modules: Ignore module.replacements defined in themes
  • [4]Hugo v0.168.0 Release Notes
  • [5]Hugo Official GitHub Repository

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•about 2 hours ago•CVE-2026-135388
9.1

CVE-2026-135388: Cryptographic Signature Verification Bypass in Pion DTLS

CVE-2026-135388 (GHSA-7c2r-jhm9-43vf) is an improper verification of cryptographic signature vulnerability (CWE-347) in Pion DTLS, a pure Go implementation of Datagram Transport Layer Security (RFC 6347). The vulnerability stems from signature scheme confusion and missing cryptographic parameter binding in the handshake verification functions verifyKeySignature and verifyCertificateVerify. By presenting a genuine peer certificate paired with an incompatible or digest-less signature hash algorithm on the wire, an unauthenticated network adversary can bypass signature verification without possessing the peer's private key. This allows peer impersonation and full compromise of confidentiality and integrity in DTLS-protected channels, including WebRTC sessions utilizing SDP certificate fingerprint verification.

Alon Barad
Alon Barad
4 views•10 min read
•about 3 hours ago•CVE-2026-134024
6.8

CVE-2026-134024: Latent Server-Side Request Forgery Gadget in TastyIgniter Media Attachment Handler

CVE-2026-134024 is a Server-Side Request Forgery (SSRF) vulnerability (CWE-918) in the TastyIgniter open-source restaurant management platform prior to version 4.4.4. The flaw resides in the Media::addFromUrl() helper method within the tastyigniter/core package, which initiates outbound HTTP GET requests to caller-supplied URLs and persists the response body without validating the URI scheme, target hostname, or resolved IP address. Although unreachable in a default unextended installation, the method functions as a latent SSRF gadget that exposes the host environment to internal network reconnaissance and cloud metadata extraction when invoked by third-party extensions or custom application code.

Alon Barad
Alon Barad
2 views•10 min read
•about 4 hours ago•CVE-2026-61832
7.5

CVE-2026-61832: Improper Certificate Validation and Insecure Deserialization in NukeViet CMS

CVE-2026-61832 is a compound vulnerability in NukeViet CMS versions prior to 4.6.00 resulting from disabled TLS certificate validation (CWE-295) in internal HTTP clients and unrestricted PHP deserialization (CWE-502) in administrative extension store handlers. An adversary-in-the-middle (AiTM) attacker can intercept outbound HTTPS connections to the NukeViet extension store API and inject a crafted serialized PHP object. When an administrator interacts with the extension store, the application deserializes the response, triggering an in-tree Property-Oriented Programming (POP) gadget chain in Guzzle to achieve arbitrary file write and remote code execution.

Amit Schendel
Amit Schendel
5 views•10 min read
•about 5 hours ago•CVE-2026-69217
8.7

CVE-2026-69217: HTTP Request and Response Smuggling in http4s ember-core

CVE-2026-69217 (also tracked as GHSA-p83c-4wj9-p6w9) is an HTTP request and response smuggling vulnerability in the ember-core module of the http4s Scala library. Prior to versions 0.23.35 and 1.0.0-M47, the HTTP/1.1 message parser failed to reject HTTP messages containing duplicate Content-Length header fields with conflicting values or sign-prefixed numeric values. Instead of returning a 400 Bad Request error as mandated by RFC 9112 Section 6.3, the parser accepted all occurrences sequentially and honored the final Content-Length value, while also permitting negative numbers via Scala's standard string-to-long conversion. When deployed behind a reverse proxy or intermediary that prioritizes the first Content-Length header or handles non-digit characters differently, unauthenticated remote attackers can desynchronize persistent HTTP/1.1 connections to perform web cache poisoning, bypass front-end security controls, and capture cross-user HTTP requests.

Amit Schendel
Amit Schendel
5 views•11 min read
•5 days ago•CVE-2026-65973
6.4

CVE-2026-65973: Local OS Command Injection in Laradocs KaTeX Server-Side Rendering

CVE-2026-65973 (GHSA-h746-qpxh-ph7g) is a local operating system command injection vulnerability (CWE-78) in the PeteBishwhip/laradocs package for Laravel. Versions from 0.4.0 to before 1.0.0 fail to sanitize or escape the configured Node.js binary path before passing it as part of a command string to PHP's proc_open() function during server-side KaTeX rendering. An attacker with the ability to modify local configuration files or environment variables can inject shell metacharacters to execute arbitrary OS commands under the privileges of the web server process.

Amit Schendel
Amit Schendel
21 views•9 min read
•5 days ago•CVE-2026-65971
7.6

CVE-2026-65971: SQL Injection in Livewire PowerGrid via Public sortDirection Property

A SQL injection vulnerability exists in power-components/livewire-powergrid versions 6.0.0 through 6.10.3. The public Livewire component property sortDirection is interpolated directly into raw SQL ORDER BY clauses during natural sorting operations without prior validation. By clearing the sortField property to bypass standard Laravel query builder protections, an attacker can inject arbitrary SQL expressions via POST requests to the /livewire/update endpoint.

Amit Schendel
Amit Schendel
14 views•9 min read