GHSA-8394-6f8r-whxg

Suggest an improvement
Source
https://github.com/advisories/GHSA-8394-6f8r-whxg
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/08/GHSA-8394-6f8r-whxg/GHSA-8394-6f8r-whxg.json
JSON Data
https://api.test.osv.dev/v1/vulns/GHSA-8394-6f8r-whxg
Aliases
Downstream
MINI (2)
Published
2026-08-17T16:37:34Z
Modified
2026-08-18T14:55:41Z
Severity
  • 6.9 (Medium) CVSS_V4 - CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N CVSS Calculator
Summary
Terragrunt: Arbitrary File Deletion via Malicious Module Manifest
Details

Summary

Terragrunt is vulnerable to an arbitrary file deletion flaw when downloading external modules. If a remote module contains a maliciously crafted .terragrunt-module-manifest file, Terragrunt can be tricked into deleting files anywhere on the local filesystem that the Terragrunt process has access to.

Impact

This vulnerability impacts users who download and run untrusted or compromised OpenTofu/Terraform modules. The file deletion occurs during the module download and initialization phase, meaning it happens before OpenTofu or Terraform executes.

In a CI/CD environment or automated runner, an attacker-controlled module could delete arbitrary files, causing denial of service in the deployment pipeline. In a local environment, it could lead to the loss of local source code or configuration files.

This vulnerability is a deletion-only primitive; it does not directly allow for arbitrary code execution (RCE) or data exfiltration.

Affected Versions

  • Terragrunt < v1.0.4

Patches

This vulnerability has been resolved in Terragrunt version v1.0.4.

All users are strongly advised to upgrade.

Workarounds

If users cannot upgrade immediately, they can mitigate this risk by:

  1. Strictly auditing the source URLs of all remote modules used in their Terragrunt configurations.
  2. Only consuming modules from trusted, internally vetted sources or verified registries.
  3. Pinning module versions to specific, known-safe Git commit SHAs rather than mutable tags or branches.

Technical Details

Terragrunt tracks files copied into a downloaded module's working directory using a .terragrunt-module-manifest file. During the directory cleanup process, Terragrunt decodes the entries in this manifest and removes the listed files to prepare a fresh directory for OpenTofu/Terraform runs.

Previously, Terragrunt trusted the manifest provided by the downloaded module without verifying that the paths scheduled for deletion remained within the boundaries of the module's destination directory. An attacker could forge a manifest containing directory traversal paths, causing the cleanup function to target files outside the cache. The patch introduces a secure boundary check to ensure all cleaned paths remain safely isolated inside the intended manifest folder.

Credit

Terragrunt would like to thank Francesco Sabiu (@fsabiu) for discovering and responsibly disclosing this vulnerability.

Database specific
{
    "cwe_ids": [
        "CWE-20"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-08-17T16:37:34Z",
    "nvd_published_at": null,
    "severity": "MODERATE"
}
References

Affected packages

Go / github.com/gruntwork-io/terragrunt

Package

Name
github.com/gruntwork-io/terragrunt
View open source insights on deps.dev
Purl
pkg:golang/github.com/gruntwork-io/terragrunt

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
1.0.4

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/08/GHSA-8394-6f8r-whxg/GHSA-8394-6f8r-whxg.json"