Command Injection Affecting aws-sam-cli package, versions [,1.166.2)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.88% (59th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Command Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PYTHON-AWSSAMCLI-21460721
  • published23 Oct 2026
  • disclosed22 Oct 2026
  • creditCipher by Causal Security

Introduced: 22 Oct 2026

NewCVE-2026-115414  (opens in a new tab)
CWE-78  (opens in a new tab)

How to fix?

Upgrade aws-sam-cli to version 1.166.2 or higher.

Overview

aws-sam-cli is an AWS SAM CLI is a CLI tool for local development and testing of Serverless applications

Affected versions of this package are vulnerable to Command Injection via the Makefile generator in makefile_generator.py, which interpolates an attacker-controlled Terraform resource address into a shell command string with insufficient escaping. The generator escapes only double-quote characters, leaving backticks and $(...) constructs unescaped, so a malicious for_each key or tampered plan file can inject arbitrary shell commands that execute on the build host when a user runs sam build --hook-name terraform. Additionally, embedded newlines in a resource address can split a generated Makefile recipe into multiple physical lines, bypassing shell-level quoting entirely.

CVSS Base Scores

version 4.0
version 3.1