
Key points
- CVE-2026-115414 allows OS command injection in the SAM CLI Terraform hook.
- Impacted versions range from 1.63.0 through 1.166.1.
- AWS released version 1.166.2 to fix the shell metacharacter issue.
AWS SAM CLI contains an OS command injection flaw that lets attackers execute arbitrary commands on build hosts. The issue, tracked as CVE-2026-115414, affects the Terraform hook used during serverless application builds. According to AWS Security Bulletins published on October 22, 2026, the vulnerability allows code execution as the build user if an actor can influence the Terraform configuration or plan file.
The Terraform hook generates a Makefile recipe that interpolates resource addresses without fully neutralizing shell metacharacters. This gap permits command injection when processing untrusted inputs. AWS classifies the bulletin as important and requires attention. The flaw impacts versions 1.63.0 through 1.166.1. This follows similar command injection reports, such as the nodejs-whisper library flaw Malware Chronicle covered in October 2026.
What we know
AWS identified the issue in its open-source framework for building serverless applications. The specific problem lies in the sam build --hook-name terraform command. When this hook processes a Terraform resource address, it fails to sanitize shell metacharacters properly. This allows an attacker who controls the input files to inject and run commands on the host machine.
Shubham Raj of Cipher by Causal Security reported the vulnerability through coordinated disclosure. AWS has addressed the issue in version 1.166.2. The vendor advises users to upgrade immediately and patch any forked code. Teams should also audit third-party Terraform modules and shared repositories that supply input to the build process to ensure sources are trusted.
Defender's checklist
- Verify your SAM CLI version is not between 1.63.0 and 1.166.1.
- Check if your CI/CD pipelines use the Terraform hook for builds.
- Audit Terraform configuration and plan files for untrusted sources.
- Review third-party modules for potential command injection vectors.
What analysts watch for
Teams usually examine build logs for unexpected shell commands or process spawns. Analysts check whether the build environment executed commands outside the expected Makefile recipe. They look for signs that input files contained shell metacharacters that were interpreted as commands. Persistence often involves modifying build artifacts or injecting backdoors into the generated serverless package. Spread occurs when compromised builds deploy to production environments.
What to do and how to stay safe: AWS
- Upgrade AWS SAM CLI to version 1.166.2 or later immediately.
- Patch any forked or derivative code to incorporate the new fixes.
- Ensure Terraform configuration and plan files come only from trusted sources.
- Audit third-party Terraform modules and shared repositories supplying input.
Step-by-step guide: Security Advisories: Small Business Patching Strategy
General security guidance from the Malware Chronicle newsroom. It is not confirmed advice from the organisations named in this story.
Frequently asked questions
Which versions of AWS SAM CLI are affected by CVE-2026-115414?
Versions greater than or equal to 1.63.0 and less than or equal to 1.166.1 are impacted.
What is the fix for the OS command injection in the Terraform hook?
AWS released version 1.166.2, which addresses the issue by properly neutralizing shell metacharacters.
Who discovered this vulnerability?
Shubham Raj of Cipher by Causal Security reported it through the coordinated vulnerability disclosure process.



