IT SBIT Services
Schneeberger
DEEN
CVE tracker

AWS SAM CLI: OS command injection in Terraform hook

CVE-2026-115414High 8.4

← All vulnerabilities

Summary

AWS SAM CLI versions 1.63.0 up to 1.166.1 contain an OS command injection in the Terraform hook (sam build --hook-name terraform). A Terraform resource address is inserted without full neutralization into a generated Makefile recipe. An attacker who can influence the Terraform configuration or plan file processed by a build can run arbitrary commands as the build user on the build host, without AWS credentials. The flaw affects local build processes and is not exposed directly to the internet.

Affected

  • AWS SAM CLI (aws-sam-cli, PyPI) 1.63.0 up to and including 1.166.1
  • Forks and derivative code that contain the affected Terraform hook code

Fixed in

AWS SAM CLI 1.166.2 or later.

Workaround

  • Use Terraform configuration and plan files for sam build --hook-name terraform only from trusted sources.
  • Audit third-party Terraform modules and shared repositories that supply input to the build.
  • No vendor-documented setting to disable the hook is known. Unknown.

Exploitation

  • No exploitation is known according to the vendor, the CISA SSVC assessment (Exploitation: none, Automatable: no) and VulDB.
  • No public proof of concept found.
  • As far as known, not listed in the CISA KEV catalog.

Our recommendation

  • Check whether SAM CLI is installed on developer machines, build servers and CI/CD runners, and which version is used.
  • Upgrade to 1.166.2 or later, including forks and distribution packages.
  • Check whether sam build --hook-name terraform is used; if so, restrict who may change Terraform code and plan files and review third-party modules.
  • If untrusted input may have been built, rotate CI/CD secrets on the affected runners.

Public exploits

PoC-in-GitHub, Metasploit and Exploit-DB list nothing for this CVE.

Research sources

Researched and written up in English and German by an AI (Claude by Anthropic) based on NVD, CISA, EPSS and the sources listed. The vendor information is authoritative. Researched on 1 Nov 2026, 12:08.

Original description (NVD)

OS command injection in the Terraform hook in AWS SAM CLI before 1.166.2 might allow an actor who can influence the Terraform configuration or plan file consumed by a build to execute arbitrary commands as the build user on the host running the build via a crafted Terraform resource address. To remediate this issue, users should upgrade to version 1.166.2 or later.

NVD references (3)

Sources

The tracker combines official, freely usable data sources – updated continuously:

This product uses data from the NVD API but is not endorsed or certified by the NVD. EPSS data © FIRST.org.

Affected? We can help.

We check whether your systems are affected, install updates and close the gap – continuously with the System Health Checker if you wish.