Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2026-45099

CVE-2026-45099: Terragrunt Path Traversal Vulnerability

CVE-2026-45099 is a path traversal vulnerability in Terragrunt that allows malicious modules to delete files outside the cache directory. This article covers technical details, affected versions, and mitigation.

Published:

CVE-2026-45099 Overview

CVE-2026-45099 is a path traversal vulnerability [CWE-22] in Terragrunt, an orchestration tool that scales Infrastructure as Code written in OpenTofu or Terraform. Versions prior to 1.0.4 trust paths decoded from a downloaded module's .terragrunt-module-manifest during fileManifest.Clean() in internal/util/file.go. A malicious or compromised external module can embed absolute or traversal paths in the manifest. When Terragrunt performs manifest cleanup, it deletes files outside the module cache that are accessible to the Terragrunt process. The issue is fixed in version 1.0.4.

Critical Impact

A malicious module can delete arbitrary files accessible to the Terragrunt process, wiping local source code or configuration and disrupting CI/CD pipelines before OpenTofu or Terraform executes.

Affected Products

  • Terragrunt versions prior to 1.0.4
  • Gruntwork Terragrunt orchestration binary consuming external modules
  • CI/CD pipelines invoking Terragrunt against untrusted module sources

Discovery Timeline

  • 2026-08-21 - CVE-2026-45099 published to NVD
  • 2026-08-25 - Last updated in NVD database

Technical Details for CVE-2026-45099

Vulnerability Analysis

Terragrunt caches downloaded modules and records their contents in a per-module manifest file named .terragrunt-module-manifest. During cleanup, fileManifest.Clean() in internal/util/file.go reads entries from this manifest and removes the referenced paths from disk. The cleanup routine does not constrain manifest entries to the module cache directory. Paths are trusted as decoded, including absolute paths and entries containing .. traversal sequences.

When Terragrunt consumes an external module authored or tampered with by an attacker, the manifest can point outside the intended cache root. Cleanup then deletes files anywhere the Terragrunt process has write access. This yields a deletion-only primitive rather than arbitrary write or code execution. In practice, the impact spans developer workstations and shared build agents where Terragrunt may run under privileged service accounts.

Root Cause

The root cause is insufficient path validation on untrusted input. fileManifest.Clean() treats the manifest as authoritative and does not verify that each entry resolves inside the module cache boundary. This matches CWE-22 (Improper Limitation of a Pathname to a Restricted Directory).

Attack Vector

Exploitation requires a victim to run Terragrunt against a malicious or compromised module source. The attacker publishes a module whose manifest contains absolute or traversal paths, for example /etc/nginx/nginx.conf or ../../workspace/main.tf. On the next cleanup pass, Terragrunt deletes those files. Refer to the Gruntwork Security Advisory GHSA-8394-6f8r-whxg and the fix commit for technical details.

Detection Methods for CVE-2026-45099

Indicators of Compromise

  • Unexpected deletion of files in workspace, repository, or system directories following a terragrunt invocation.
  • Presence of .terragrunt-module-manifest files containing absolute paths or .. traversal sequences.
  • Terragrunt module sources pointing to untrusted third-party registries or forks.

Detection Strategies

  • Inspect .terragrunt-module-manifest files in the module cache for entries that resolve outside the cache root using tools such as grep -E '^/|\.\.'.
  • Audit CI/CD logs for Terragrunt runs that report file removals outside .terragrunt-cache/.
  • Monitor filesystem activity on build agents for unlink syscalls originating from the terragrunt binary against paths outside the module cache.

Monitoring Recommendations

  • Enable file integrity monitoring on repository roots, CI workspaces, and shared configuration paths used by build agents.
  • Log the version of Terragrunt executed in every pipeline run and alert on versions below 1.0.4.
  • Track module source URLs consumed by Terragrunt and flag modules from unapproved registries.

How to Mitigate CVE-2026-45099

Immediate Actions Required

  • Upgrade Terragrunt to version 1.0.4 or later on developer workstations and CI/CD runners.
  • Inventory all Terragrunt module sources and remove references to untrusted or unpinned external modules.
  • Rotate any secrets or credentials exposed on build agents that executed Terragrunt against untrusted modules.

Patch Information

The fix ships in Terragrunt release v1.0.4. See Pull Request #6032 and the fix commit for the validation logic added to fileManifest.Clean().

Workarounds

  • Pin all Terragrunt modules to trusted, version-locked sources and verify checksums before use.
  • Run Terragrunt under a least-privilege service account whose filesystem access is limited to the working directory and module cache.
  • Execute Terragrunt inside ephemeral containers so any file deletions are discarded when the container exits.
bash
# Configuration example
# Upgrade Terragrunt to the patched release
curl -L -o /usr/local/bin/terragrunt \
  https://github.com/gruntwork-io/terragrunt/releases/download/v1.0.4/terragrunt_linux_amd64
chmod +x /usr/local/bin/terragrunt
terragrunt --version   # expect v1.0.4 or later

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.