6.9medium
Terragrunt: Arbitrary File Deletion via Malicious Module Manifest
- Severity
- 6.9medium CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.42% (higher than 38% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-8394-6f8r-whxgGO-2026-6241
Description
Terragrunt is a flexible orchestration tool that allows Infrastructure as Code written in OpenTofu or Terraform to scale. Prior to 1.0.4, Terragrunt trusts 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 place absolute or traversal paths in the manifest, causing cleanup to delete files outside the module cache that are accessible to the Terragrunt process before OpenTofu or Terraform executes. This deletion-only primitive can remove local source code or configuration and disrupt CI/CD pipelines. This issue is fixed in version 1.0.4.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| gruntwork-io terragrunt | < 1.0.4 | CVE List |
| github.com/gruntwork-io/terragrunt (Go) | before 1.0.4 | GitHub Advisory Database, Go Vulnerability Database |
All scores
| GitHub_M | 6.9medium CVSS:4.0 | 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 |
| GitHub | medium CVSS:4.0 | 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 |
Classification
What each source says
CVE List
Terragrunt is a flexible orchestration tool that allows Infrastructure as Code written in OpenTofu or Terraform to scale. Prior to 1.0.4, Terragrunt trusts 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 place absolute or traversal paths in the manifest, causing cleanup to delete files outside the module cache that are accessible to the Terragrunt process before OpenTofu or Terraform executes. This deletion-only primitive can remove local source code or configuration and disrupt CI/CD pipelines. This issue is fixed in version 1.0.4.
GitHub Advisory Database
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:
- Strictly auditing the source URLs of all remote modules used in their Terragrunt configurations.
- Only consuming modules from trusted, internally vetted sources or verified registries.
- 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.
Go Vulnerability Database
Terragrunt: Arbitrary File Deletion via Malicious Module Manifest in github.com/gruntwork-io/terragrunt
NVD (es)
Terragrunt es una herramienta de orquestación flexible que permite escalar la Infraestructura como Código escrita en OpenTofu o Terraform. Antes de la versión 1.0.4, Terragrunt confía en las rutas decodificadas del archivo .terragrunt-module-manifest de un módulo descargado durante fileManifest.Clean() en internal/util/file.go. Un módulo externo malicioso o comprometido puede colocar rutas absolutas o de recorrido en el manifiesto, provocando que la limpieza elimine archivos fuera de la caché del módulo que son accesibles para el proceso de Terragrunt antes de que OpenTofu o Terraform se ejecuten. Esta primitiva de solo eliminación puede eliminar código fuente o configuración local y alterar las pipelines de CI/CD. Este problema está solucionado en la versión 1.0.4.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-45099 changed 2026-08-25 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-8394-6f8r-whxg changed 2026-08-18 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2026-6241 changed 2026-08-18 | CC-BY-4.0 |
| NVD | CVE-2026-45099 changed 2026-10-12 | Public domain |