Skip to main content

AWS SAM CLI CVE-2026-115414

| EUVDEUVD-2026-108281 HIGH
OS Command Injection (CWE-78)
2026-10-22 AMZN
8.4
CVSS 4.0 · Vendor: AMZN
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Poison Terraform module/plan input
  2. Delivery
    Embed command substitution in resource address
  3. Exploit
    Victim runs sam build --hook-name terraform
  4. Execution
    Shell metacharacters execute as build user
  5. Impact
    Exfiltrate CI/CD secrets and tamper artifacts

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization OS command sanitization, avoid shell exec
MITRE ATT&CK

2 techniques across 1 tactic: Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Requires that the target actually uses the Terraform hook build mode (sam build --hook-name terraform) in AWS SAM CLI 1.63.0 through 1.166.1, AND that an attacker can influence the Terraform configuration or a Terraform plan file consumed by that build - typically via an untrusted or compromised third-party Terraform module, shared repository, or plan artifact. The payload is a crafted Terraform resource address of a SAM metadata resource containing shell metacharacters (e.g. command substitution), which the hook passes through because only double-quote characters were escaped. Exploitation is LOCAL to the build host (AV:L) and requires the build to be invoked (UI:A), but needs no AWS credentials and executes even if the build subsequently fails. Limiting factors: default SAM workflows that do not use the Terraform hook, or builds that consume only trusted first-party Terraform sources, are not exposed; the per-vendor workaround is to source Terraform config/plan files only from trusted sources and audit third-party modules, with upgrade to 1.166.2 as the recommended complete remediation.

Impact

This is a credible but conditional supply-chain/build-time risk rather than a mass-exploitable network flaw. The authoritative CVSS 4.0 vector (AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H) scores 8.4 and correctly models the mechanics: exploitation is Local (the malicious input is consumed by a build running on the host), requires Active user interaction (someone must invoke sam build --hook-name terraform), needs no privileges on the SAM CLI side (PR:N), and yields High impact to confidentiality, integrity and availability with no scope change. No EPSS score was supplied and the CVE is NOT in CISA KEV, so there is no_public_exploit identified at time of analysis and no evidence of active exploitation - treat the headline 8.4 as severity, not imminence. The vuln.today Decision label is 'this_week' (not act_now/emergency), consistent with a patched, credibly-impactful but not-yet-exploited issue. The signals are internally consistent: a serious code-execution bug gated behind the precondition that an attacker can influence the Terraform configuration or plan file. The realistic threat is poisoned third-party Terraform modules or shared repositories flowing into CI/CD, where command execution during the build exposes pipeline credentials and allows artifact tampering even if the build later fails.

Exploit ScenarioDerived

An attacker contributes or compromises a Terraform module (or plan file) consumed by a target's build, embedding shell command-substitution syntax inside a Terraform resource address. When a developer or CI/CD pipeline runs sam build --hook-name terraform, the SAM CLI inserts that address into a shell command while neutralizing only double quotes, so the injected command executes as the build user - harvesting CI/CD credentials and tampering with artifacts. No public exploit is identified at time of analysis, but the GHSA advisory documents the mechanism in detail.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv2 – Oct 22, 2026

OS command injection in the Terraform hook of AWS SAM CLI (sam build --hook-name terraform) lets an actor who can influence the Terraform configuration or plan file consumed by a build execute arbitrary commands as the build user on the build host. The flaw affects versions 1.63.0 through 1.166.1; the hook inserted the Terraform resource address of each SAM metadata resource into a shell command while neutralizing only double-quote characters, so a crafted resource address containing shell metacharacters (such as command substitution syntax) was passed through unmodified. No privileges on the host are required (PR:N) and no AWS credentials are needed, but the build must be invoked by a user (UI:A) and the target must actually use the Terraform hook build mode with attacker-influenceable Terraform input, so exposure is limited to builds consuming untrusted or compromised third-party modules, shared repositories, or plan artifacts; no public exploit code was identified at time of analysis, and the risk is a conditional supply-chain/build-time one rather than a mass-exploitable network flaw.

Earlier versions of this analysis (1)
v1 Oct 22, 2026 - 19:06 CVSS 7.8

OS command injection in the AWS SAM CLI Terraform hook allows 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, affecting versions before 1.166.2. Exploitation is local and requires the user to initiate a build (UI:R), and the Terraform-hook build path must be in use with attacker-influenceable Terraform input. Version 1.166.2 contains the vendor fix; no public exploit identified at time of analysis.

RemediationAI

Vendor-released patch: upgrade to AWS SAM CLI 1.166.2 or later (release tag https://github.com/aws/aws-sam-cli/releases/tag/v1.166.2, advisory https://aws.amazon.com/security/security-bulletins/2026-145-aws/); the release publishes SHA256 hashes and signatures for aws-sam-cli-linux-x86_64.zip, aws-sam-cli-linux-arm64.zip, aws-sam-cli-macos-x86_64.pkg, aws-sam-cli-macos-arm64.pkg and AWS_SAM_CLI_64_PY3.msi, so verify the artifact hash after upgrading, and patch any forked or derivative code to incorporate the fix. The vendor-stated workaround, appropriate only until the upgrade is applied, is to ensure that Terraform configuration files and plan files consumed by sam build --hook-name terraform come only from trusted sources, and to audit third-party Terraform modules and shared repositories that supply input to the build; this removes the injection vector but depends on the integrity of every module and plan artifact in the build path, whereas the vendor identifies upgrading to a fixed version as the recommended complete remediation. Note the execution context: payloads run as the build user, do not require AWS credentials, and run even if the build subsequently fails, so credentials present in the build environment should be treated as potentially exposed and rotated if a build consumed untrusted Terraform input.

Affected VersionsENISA

aws-sam-cli 1.63.0 <1.166.2

Affected Packages

euvd aws_sam_cli fix: 1.166.2

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

AWS SAM CLI is Amazon's open-source command line tool for building, testing and deploying serverless applications, distributed as a pip package (pip/aws-sam-cli) and as platform installers (Linux x86_64/arm64 zips, macOS x86_64/arm64 pkg, Windows MSI); CPE cpe:2.3:a:aws:aws-sam-cli captures the affected product. The vulnerable component is the Terraform build hook, enabled with sam build --hook-name terraform, which generates build instructions (Makefiles) for Lambda resources declared through SAM metadata in Terraform. To do so it interpolates the Terraform resource address of each SAM metadata resource into a shell command, and the sanitization applied to that address escaped only double-quote characters; other shell metacharacters, including command substitution syntax, survived into the generated command. This is CWE-78 (improper neutralization of special elements used in an OS command), a quoting/escaping failure rather than a memory-safety issue: any Terraform resource address an attacker can plant in the configuration or plan file reaches the shell of the host running the build. Commands execute during the build as the build user, require no AWS credentials, and run even if the build subsequently fails, so secrets present in the build environment (for example CI/CD credentials) and build artifacts themselves are exposed to disclosure and tampering. The trigger depends on attacker-influenced Terraform input reaching the hook; the fix commit in the 1.166.2 release is titled 'fix(terraform-hook): improve Makefile generation'.

Know when AWS gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (AMZN) PRIMARY 8.4 HIGH
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
vuln.today AI 7.8 HIGH

Malicious input is consumed by a locally-run build (AV:L) that must be invoked (UI:R); no SAM-side privileges are needed (PR:N) and injected commands run with full read/write as the build user (C/I/A:H).

3.1 AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
4.0 AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (AMZN).

CVSS VectorVendor: AMZN

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
Active
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

3
Analysis Updated
Oct 22, 2026 - 19:27 vuln.today
v2 - CVSS changed
CVSS changed
Oct 22, 2026 - 19:23 NVD
7.8 (HIGH) 8.4 (HIGH)
CVE Published
Oct 22, 2026 - 18:34 cve.org
HIGH 7.8

DescriptionCVE.org

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.

Executive ViewAI

Why It Matters

CVE-2026-115414 is a high-severity OS command injection flaw in the Terraform hook of AWS SAM CLI versions 1.63.0 through 1.166.1. This vulnerability enables an attacker who can influence Terraform configuration or plan files to execute arbitrary commands as the build user on the build host. Organizations are affected if they use SAM CLI with the Terraform hook in build pipelines that consume untrusted or third-party Terraform modules, repositories, or plan artifacts; such usage could lead to full compromise of the build environment.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

Prevalence
Medium
popular AWS serverless build tool, but only the Terraform hook mode is affected
Data Quality
4 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS N/A
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Small
Automatable· derived
No
Human Impact
High

Priority Score

42
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +42
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

OS command injection occurs when an application passes unsanitized user input directly into system shell commands.

More in AWS

View all
CVE-2026-103956 CRITICAL POC
10.0 Oct 02

Loom for AWS deployments running a version before 1.6.1 with no identity provider configured expose an unauthenticated s

CVE-2026-27702 CRITICAL POC
9.9 Feb 25

Unauthorized data access in Budibase low-code platform before 3.30.4 allows unauthenticated users to manipulate internal

CVE-2025-64709 CRITICAL POC
9.9 Nov 13

Authenticated Typebot users can abuse the webhook block (HTTP Request component) in versions prior to 3.13.1 to issue ar

CVE-2020-37153 CRITICAL POC
9.8 Feb 11

Multiple vulnerabilities in ASTPP 4.0.1 including XSS and command injection in SIP device configuration and plugin manag

CVE-2026-87911 CRITICAL POC
9.0 Sep 09

Remote code execution in Amazon awslabs postgres-mcp-server before 1.1.7 lets remote actors run arbitrary OS commands on

CVE-2026-11393 HIGH POC
8.8 Jun 08

Remote code execution in AWS AgentCore CLI before v0.14.2 allows authenticated attackers to inject Python code via craft

CVE-2026-18140 HIGH POC
8.7 Jul 30

Denial of service in the aws-smithy-json Rust runtime crate (versions before 0.62.7) lets remote unauthenticated attacke

CVE-2026-16756 HIGH POC
8.7 Jul 23

Denial of service in Amazon's aws-smithy-http-server Rust crate (versions prior to 0.66.5) lets remote unauthenticated a

CVE-2026-16796 HIGH POC
8.4 Jul 23

Argument injection in the AWS Bedrock AgentCore Python SDK before 1.18.1 lets a remote authenticated user run arbitrary

CVE-2026-9133 HIGH POC
8.3 May 20

Arbitrary file read in amazon-mq rabbitmq-aws before 0.2.1 allows authenticated remote users to read any file accessible

CVE-2026-13763 HIGH POC
7.9 Jun 29

WAF managed-rule body inspection on AWS Application Load Balancer (ALB) can be bypassed by remote actors who fragment an

CVE-2026-13762 HIGH POC
7.9 Jun 29

WAF inspection bypass in Amazon CloudFront (with AWS WAF enabled) lets remote actors smuggle malicious request bodies pa

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy