Description
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.
Published: 2026-10-22
Score: 8.4 High
EPSS: < 1% Very Low
KEV: No
Impact: Remote Code Execution
Action: Immediate Patch
AI Analysis

Impact

The vulnerability is an operating system command injection in the Terraform hook of AWS SAM CLI versions earlier than 1.166.2. By tampering with the Terraform configuration or plan file that the CLI consumes, an attacker who can influence that file can cause the CLI to execute arbitrary commands as the user running the build on the host machine. This flaw is a classic example of CWE‑78 and results in remote code execution on the build host.

Affected Systems

The affected product is AWS SAM CLI from the AWS vendor. All releases prior to 1.166.2 are impacted, including any instance where the CLI processes Terraform configuration or plan files supplied by a build process. Clients running older versions on any operating system are susceptible if they accept untrusted Terraform artifacts.

Risk and Exploitability

With a CVSS score of 8.4 the vulnerability is considered high severity. EPSS data is not available, but the lack of a KEV listing does not diminish the risk for organizations that build using SAM CLI in potentially untrusted environments. An attacker who can inject malicious content into a Terraform file or plan can trigger the injection when the CLI runs the build, thereby executing commands with the host user’s privileges. The attack vector is local to the build host, requiring attacker control over the build configuration files.

Generated by OpenCVE AI on October 23, 2026 at 03:37 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the AWS SAM CLI to version 1.166.2 or later.
  • If an immediate upgrade is not possible, validate that all Terraform configuration and plan files come from trusted sources before the CLI processes them.
  • Isolate the build environment, for example by using a dedicated build account or a container, and restrict execution policies to minimize the impact of potential command injection.

Generated by OpenCVE AI on October 23, 2026 at 03:37 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Fri, 23 Oct 2026 11:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Fri, 23 Oct 2026 00:45:00 +0000

Type Values Removed Values Added
Description 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.
Title OS command injection in the Terraform hook in AWS SAM CLI
First Time appeared Aws
Aws aws-sam-cli
Weaknesses CWE-78
CPEs cpe:2.3:a:aws:aws-sam-cli:*:*:*:*:*:*:*:*
Vendors & Products Aws
Aws aws-sam-cli
References
Metrics cvssV3_1

{'score': 7.8, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H'}

cvssV4_0

{'score': 8.4, 'vector': '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'}


cve-icon MITRE

Status: PUBLISHED

Assigner: AMZN

Published:

Updated: 2026-10-23T10:56:19.844Z

Reserved: 2026-10-22T13:11:04.463Z

Link: CVE-2026-115414

cve-icon Vulnrichment

Updated: 2026-10-23T10:56:01.307Z

cve-icon NVD

Status : Received

Published: 2026-10-22T19:17:47.843

Modified: 2026-10-23T12:18:12.150

Link: CVE-2026-115414

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-10-23T03:45:16Z

Weaknesses
  • CWE-78

    Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')