---
id: "GHSA-44mq-wjrh-vpj6"
kind: "vulnerability"
aliases: ["GHSA-44mq-wjrh-vpj6"]
title: "CVE-2026-115414 - OS Command Injection Issue in SAM CLI Terraform Hook"
severity: "high"
cvss: null
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["aws", "ci-cd", "lab-disclosure", "package", "sam-cli", "serverless", "terraform"]
not_affected_if: ["no-terraform-hook", "trusted-config-only", "version-outside-range"]
published_at: "2026-10-22T00:00:00+00:00"
first_seen_at: "2026-10-24T18:56:54+00:00"
updated_at: "2026-10-25T05:00:37+00:00"
sources: [{"source": "lab", "url": "https://aws.amazon.com/security/security-bulletins/rss/2026-145-aws/", "first_seen_at": "2026-10-24T18:56:54+00:00"}]
---

# CVE-2026-115414 - OS Command Injection Issue in SAM CLI Terraform Hook

The Terraform hook in AWS SAM CLI builds a Makefile recipe that interpolates a Terraform resource address without fully escaping shell metacharacters. An attacker who can influence the Terraform configuration or plan file consumed by a build can run arbitrary commands as the build user on the host running the build.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Run `sam --version` and check whether it is between `1.63.0` and `1.166.1` inclusive.
- Check whether builds use `sam build --hook-name terraform` in CI or on developer machines.
- Review where the Terraform configuration and plan files come from, including third-party modules and shared repositories.

## Fix

- Upgrade AWS SAM CLI to `v1.166.2` or later.
- Until upgraded, only consume Terraform configuration and plan files from trusted sources and audit third-party Terraform modules.
- Patch any forked or derivative copies of SAM CLI.

## Timeline

- 2026-10-24T18:56:54+00:00 lab https://aws.amazon.com/security/security-bulletins/rss/2026-145-aws/ — AWS: CVE-2026-115414 - OS Command Injection Issue in SAM CLI Terraform Hook

## Documents

- [advisory] AWS: CVE-2026-115414 - OS Command Injection Issue in SAM CLI Terraform Hook https://aws.amazon.com/security/security-bulletins/rss/2026-145-aws/

## From the sources

CVE-2026-115414 - OS Command Injection Issue in SAM CLI Terraform Hook

### CVE-2026-115414 - OS Command Injection Issue in SAM CLI Terraform Hook

Bulletin ID: 2026-145-AWS Scope: AWS Content Type: Important (requires attention) Publication Date: 10/22/2026 11:30 AM PDT

Description:

AWS SAM CLI is an open-source framework for building serverless applications. We identified CVE-2026-115414, an OS command injection issue in the Terraform hook (sam build --hook-name terraform) in AWS SAM CLI. The Terraform hook generates a Makefile recipe that interpolates a Terraform resource address without fully neutralizing shell metacharacters, which could 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.

Impacted versions: >=1.63.0, <=1.166.1

Resolution:

This issue has been addressed in AWS SAM CLI version v1.166.2. We recommend upgrading to the latest version and ensuring any forked or derivative code is patched to incorporate the new fixes..

Workarounds:

Ensure that Terraform configuration files and plan files consumed by sam build --hook-name terraform come only from trusted sources, and audit third-party Terraform modules and shared repositories that supply input to the build. Upgrading to a fixed version is the recommended remediation.

References:

- CVE-2026-115414
- GHSA-44mq-wjrh-vpj6

Acknowledgement:

We would like to thank Shubham Raj of Cipher by Causal Security for collaborating on this issue through the coordinated vulnerability disclosure process.

 Please email aws-security@amazon.com with any security questions or concerns.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
