DEV Community

CVE Reports
CVE Reports

Posted on Originally published at cvereports.com

CVE-2026-116676: CVE-2026-116676: OS Command Injection via Terraform Workspace Parameter in Atlantis

CVE-2026-116676: OS Command Injection via Terraform Workspace Parameter in Atlantis

Vulnerability ID: CVE-2026-116676
CVSS Score: 8.8
Published: 2026-10-27

CVE-2026-116676 (GHSA-rjh2-4xgw-p2hj) is an OS command injection vulnerability (CWE-78) in Atlantis, an open-source Go application that automates Terraform pull request workflows via webhooks. From version 0.4.0 prior to version 0.47.1, Atlantis constructed Terraform and Conftest commands by joining argument slices into a single space-separated string and passing them to a shell interpreter (sh -c). Because user-controlled workspace names from atlantis.yaml, pull request comments, HCL configurations, and API requests were insufficiently validated against shell metacharacters, an authenticated contributor eligible to trigger a Terraform plan can execute arbitrary commands under the Atlantis service account.

TL;DR

Atlantis versions 0.4.0 through 0.47.0 concatenate user-controlled Terraform workspace arguments into a single string executed via sh -c. Authenticated contributors can inject shell metacharacters via atlantis.yaml, pull request comments (-w), HCL cloud blocks, or the HTTP API to achieve remote code execution during the plan workflow.


Technical Details

  • Vulnerability Type: OS Command Injection (CWE-78)
  • CVSS v3.1 Score: 8.8 High (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H)
  • Affected Versions: >= 0.4.0, < 0.47.1
  • Patched Version: 0.47.1
  • Attack Vector: Network (PR atlantis.yaml, PR comments, HCL cloud blocks, HTTP API)
  • Primary Impact: Remote Code Execution and credential disclosure under Atlantis service account
  • CISA KEV Status: Not Listed

Affected Systems

  • runatlantis/atlantis
  • github.com/runatlantis/atlantis
  • Atlantis: >= 0.4.0, < 0.47.1 (Fixed in: 0.47.1)

Code Analysis

Commit: f04df0d

Official fix commit on main branch replacing sh -c with argv execution, adding ValidateWorkspaceName, and restricting environment variable expansion.

Commit: 8dd22b4

Backport fix commit on release-0.47 branch for Atlantis v0.47.1 release.

Mitigation Strategies

  • Upgrade Atlantis to version 0.47.1 or later to eliminate shell-based command execution and enforce centralized workspace validation.
  • Ensure --allow-fork-prs is set to false to prevent untrusted external contributors from triggering plans via forked pull requests.
  • Restrict repository-level configuration overrides (--allow-repo-config=false or via server-side repos.yaml) where custom atlantis.yaml files are unnecessary.
  • Implement strict outbound network egress filtering on the Atlantis runtime environment to block unauthorized external connections.

Remediation Steps:

  1. Update the Atlantis binary, Docker container image, or Helm chart deployment to release v0.47.1 or newer.
  2. Verify server startup flags to confirm --allow-fork-prs is disabled unless explicitly required and mitigated by other controls.
  3. Audit recent pull request comments and atlantis.yaml commit histories for workspace arguments containing shell control characters (;, &, |, $, `) or -parallelism=$ variable probing.
  4. If any suspicious workspace strings or unexpected /bin/sh -c child processes are detected, rotate all VCS access tokens and cloud provider credentials accessible to the Atlantis runtime.

References


Read the full report for CVE-2026-116676 on our website for more details including interactive diagrams and full exploit analysis.

Top comments (0)