Impact
Infracost versions before 0.10.45 allow the Terraform Cloud or registry token to be attached to a destination hostname that originates from untrusted Terraform input without validating the host against the configured trusted host. This flaw permits an attacker who controls the Terraform code or who can influence a CI run to direct the token to an attacker‑controlled server and thereby exfiltrate that token. The vulnerability is a data confidentiality issue that could also enable unauthorized access to the Terraform Cloud account.
Affected Systems
The issue affects the Infracost tool, specifically all releases prior to version 0.10.45. The vulnerability is present in the internal/hcl/remote_variables_loader.go component and related request paths used for Terraform Cloud, remote‑plan, and Terragrunt registry interactions.
Risk and Exploitability
The CVSS score is 5.9, indicating a moderate impact. An attacker needs the ability to supply Terraform input that triggers a CI run, such as through pull_request_target or same‑repository pull requests. If the CI environment supplies a Terraform Cloud or registry token during the scan, the unvalidated hostname can leak the token to an attacker‑controlled host. The EPSS score is unavailable, and the vulnerability is not listed in the CISA KEV catalog. Nonetheless, because the attack vector relies on CI workflows that many projects use, the risk of exploitation is considered moderate.
OpenCVE Enrichment
Github GHSA