Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessPoison Terraform module/plan input
-
DeliveryEmbed command substitution in resource address
-
ExploitVictim runs sam build --hook-name terraform
-
ExecutionShell metacharacters execute as build user
-
ImpactExfiltrate 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 ( |
| 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 |
| 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 |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv2 – 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)
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
Affected Packages
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
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
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).
Primary rating from Vendor (AMZN).
CVSS VectorVendor: AMZN
Lifecycle Timeline
3DescriptionCVE.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
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.
Apply vendor patch.
Threat Intelligence Overview
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
OS command injection occurs when an application passes unsanitized user input directly into system shell commands.
Loom for AWS deployments running a version before 1.6.1 with no identity provider configured expose an unauthenticated s
Unauthorized data access in Budibase low-code platform before 3.30.4 allows unauthenticated users to manipulate internal
Authenticated Typebot users can abuse the webhook block (HTTP Request component) in versions prior to 3.13.1 to issue ar
Multiple vulnerabilities in ASTPP 4.0.1 including XSS and command injection in SIP device configuration and plugin manag
Remote code execution in Amazon awslabs postgres-mcp-server before 1.1.7 lets remote actors run arbitrary OS commands on
Remote code execution in AWS AgentCore CLI before v0.14.2 allows authenticated attackers to inject Python code via craft
Denial of service in the aws-smithy-json Rust runtime crate (versions before 0.62.7) lets remote unauthenticated attacke
Denial of service in Amazon's aws-smithy-http-server Rust crate (versions prior to 0.66.5) lets remote unauthenticated a
Argument injection in the AWS Bedrock AgentCore Python SDK before 1.18.1 lets a remote authenticated user run arbitrary
Arbitrary file read in amazon-mq rabbitmq-aws before 0.2.1 allows authenticated remote users to read any file accessible
WAF managed-rule body inspection on AWS Application Load Balancer (ALB) can be bypassed by remote actors who fragment an
WAF inspection bypass in Amazon CloudFront (with AWS WAF enabled) lets remote actors smuggle malicious request bodies pa
EUVD-2026-108281
NVD
CVE.org
GitHub
Exploit-DB