/

CVE-2026-44301

Severity:

HIGH RISK

(8.1)

Path Traversal / Unconstrained Filesystem Access

CVE-2026-44301

Analyzed

Vulnerability type

Category:

Path Traversal / Unconstrained Filesystem Access

CWE:

CWE-22

Impact:

Unauthorized File Read/Write via Build Pipeline

Severity:

HIGH RISK

(8.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Hugo's Node-based asset pipeline integrations (PostCSS, Babel, TailwindCSS) previously invoked Node tools without constraining their filesystem access, allowing them to read or write files outside the project directory.

When a user builds an untrusted Hugo site that enables these Node pipelines, malicious or compromised build configuration can cause unauthorized file access on the machine running hugo.

Affected context

This issue affects environments where:

  • Hugo versions from 0.43 up to (but not including) 0.161.0 are used, and
  • Node-based asset pipelines such as PostCSS, Babel, or TailwindCSS are configured, and
  • Hugo is executed against content or site repositories that may not be fully trusted.

The vulnerability arises during the static site build process, where Node tools are executed with ambient permissions and no enforced restriction to the project's working directory.

Exploit preconditions

  • Attack surface: Local machine running the Hugo build (developer workstation, CI runner, or build server).
  • Required access: Ability to influence the Hugo project being built, including its asset pipeline configuration, Node tool configuration files, or installed Node modules.
  • Trigger point: Invocation of hugo to build a site that uses the Node-based asset pipelines.
  • Why exploitation is possible: The Node tools are launched without sandboxing or path restrictions, so any code executed in these tools can access the underlying filesystem beyond the project tree, leading to unauthorized file reads or writes.

Why this happens

The core issue is a lack of boundary enforcement between the build pipeline tools and the host filesystem.

Hugo delegates asset processing to external Node-based tools (e.g., PostCSS, Babel, TailwindCSS) but does not constrain their execution context or filesystem scope.

This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), generalized here as unconstrained filesystem access: code running as part of the asset pipeline can target arbitrary paths on the host system because there is no enforced chroot, sandbox, or path validation limiting operations to the project directory.

Potential impact

  • Malicious build configuration may read sensitive files from the host (SSH keys, cloud credentials, configuration secrets).
  • Attackers could write or overwrite files outside the project directory, which could corrupt system or user data.
  • A compromised project could implant backdoors or persistence mechanisms by modifying other local code repositories or configuration files.
  • Build infrastructure (e.g., CI runners) could be used as a pivot to exfiltrate secrets or alter build artifacts.

General mitigation guidance

Effective mitigation focuses on limiting trust in build inputs and constraining external tools:

  • Prefer building only Hugo sites whose source and asset pipeline configuration are trusted and reviewed, especially when Node-based tools are enabled.
  • Run untrusted builds in isolated environments (e.g., containers, disposable VMs) with minimal host filesystem access and limited credentials.
  • Apply least privilege to build users, reducing their ability to access sensitive directories or files beyond what is necessary.
  • Configure build infrastructure to separate secrets and critical configuration from general build environments, minimizing the blast radius if a build pipeline misbehaves.
  • Favor asset processing approaches that support sandboxing or explicit path restrictions when integrating external tooling.

How teams detect issues like this

Organizations can detect or monitor for this class of risk via:

  • Code review checklists that flag projects using Node-based asset pipelines with unvetted configuration or third-party plugins.
  • Static analysis or policy-as-code rules that require isolation (e.g., containerization) for builds involving untrusted site content.
  • Monitoring build logs for unusual filesystem access patterns or unexpected file reads/writes initiated during the asset pipeline steps.
  • Periodic review of CI/CD pipelines to ensure builds do not run with excessive filesystem permissions or access to sensitive credential stores.

Sources

SourceLink
github.comgithub.com/gohugoio/hugo/security/advisories/GHSA-x597-9fr4-5857

Frequently asked

questions

Not in the traditional network sense. Exploitation typically occurs when a user or CI system locally runs hugo on a project that includes malicious or compromised asset pipeline configuration. The attacker's vector is the project content and configuration, not a direct remote request.

An attacker needs the ability to influence or control the Hugo project being built—such as contributing to a repository, supplying a theme or starter kit, or modifying Node-related configuration or dependencies used by the project.

The safest pattern is to constrain external tool execution and file access: treat asset pipelines as untrusted code, run them in isolated environments with least privilege, and ensure that they cannot access files outside designated working directories.

Future prevention relies on designing build systems with explicit trust boundaries: sandbox external tools, restrict filesystem paths, avoid running arbitrary project-controlled code with broad host privileges, and codify these requirements in CI/CD policies and security reviews.

Find out what's already
exploitable in your codebase.