{"id":"GHSA-44mq-wjrh-vpj6","kind":"vulnerability","aliases":["GHSA-44mq-wjrh-vpj6"],"related":[],"title":"CVE-2026-115414 - OS Command Injection Issue in SAM CLI Terraform Hook","description":"CVE-2026-115414 - OS Command Injection Issue in SAM CLI Terraform Hook\n\n### CVE-2026-115414 - OS Command Injection Issue in SAM CLI Terraform Hook\n\nBulletin ID: 2026-145-AWS Scope: AWS Content Type: Important (requires attention) Publication Date: 10/22/2026 11:30 AM PDT\n\nDescription:\n\nAWS SAM CLI is an open-source framework for building serverless applications. We identified CVE-2026-115414, an OS command injection issue in the Terraform hook (sam build --hook-name terraform) in AWS SAM CLI. The Terraform hook generates a Makefile recipe that interpolates a Terraform resource address without fully neutralizing shell metacharacters, which could 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.\n\nImpacted versions: >=1.63.0, <=1.166.1\n\nResolution:\n\nThis issue has been addressed in AWS SAM CLI version v1.166.2. We recommend upgrading to the latest version and ensuring any forked or derivative code is patched to incorporate the new fixes..\n\nWorkarounds:\n\nEnsure that Terraform configuration files and plan files consumed by sam build --hook-name terraform come only from trusted sources, and audit third-party Terraform modules and shared repositories that supply input to the build. Upgrading to a fixed version is the recommended remediation.\n\nReferences:\n\n- CVE-2026-115414\n- GHSA-44mq-wjrh-vpj6\n\nAcknowledgement:\n\nWe would like to thank Shubham Raj of Cipher by Causal Security for collaborating on this issue through the coordinated vulnerability disclosure process.\n\n Please email aws-security@amazon.com with any security questions or concerns.","summary":"The Terraform hook in AWS SAM CLI builds a Makefile recipe that interpolates a Terraform resource address without fully escaping shell metacharacters. An attacker who can influence the Terraform configuration or plan file consumed by a build can run arbitrary commands as the build user on the host running the build.","severity":"high","cvss":null,"epss":null,"exploited":false,"exploited_at":null,"products":[],"ecosystems":[],"tags":["aws","ci-cd","lab-disclosure","package","sam-cli","serverless","terraform"],"not_affected_if":["no-terraform-hook","trusted-config-only","version-outside-range"],"how_to_check":"- Run `sam --version` and check whether it is between `1.63.0` and `1.166.1` inclusive.\n- Check whether builds use `sam build --hook-name terraform` in CI or on developer machines.\n- Review where the Terraform configuration and plan files come from, including third-party modules and shared repositories.","fix":"- Upgrade AWS SAM CLI to `v1.166.2` or later.\n- Until upgraded, only consume Terraform configuration and plan files from trusted sources and audit third-party Terraform modules.\n- Patch any forked or derivative copies of SAM CLI.","status":"open","published_at":"2026-10-22T00:00:00+00:00","first_seen_at":"2026-10-24T18:56:54+00:00","triaged_at":"2026-10-25T05:00:37+00:00","updated_at":"2026-10-25T05:00:37+00:00","category":"package","confidence":0.8,"triage":{"at":"2026-10-25T05:00:37Z","model":"claude-haiku-5-5","output":{"fix":"- Upgrade AWS SAM CLI to `v1.166.2` or later.\n- Until upgraded, only consume Terraform configuration and plan files from trusted sources and audit third-party Terraform modules.\n- Patch any forked or derivative copies of SAM CLI.","reach":"unknown","title":"AWS SAM CLI: Terraform hook lets crafted config run shell commands","impact":"high","summary":"The Terraform hook in AWS SAM CLI builds a Makefile recipe that interpolates a Terraform resource address without fully escaping shell metacharacters. An attacker who can influence the Terraform configuration or plan file consumed by a build can run arbitrary commands as the build user on the host running the build.","category":"package","nicknames":[],"who_cares":["aws","sam-cli","terraform","ci-cd","serverless"],"confidence":0.8,"needs_auth":"unknown","worst_case":"Arbitrary commands run as the build user on the build host.","analyst_note":"","how_to_check":"- Run `sam --version` and check whether it is between `1.63.0` and `1.166.1` inclusive.\n- Check whether builds use `sam build --hook-name terraform` in CI or on developer machines.\n- Review where the Terraform configuration and plan files come from, including third-party modules and shared repositories.","needs_analyst":false,"not_affected_if":["no-terraform-hook","trusted-config-only","version-outside-range"],"who_is_affected":"Teams that run `sam build --hook-name terraform` on SAM CLI versions from `1.63.0` through `1.166.1` are exposed. The risk depends on whether untrusted parties can influence the Terraform configuration or plan file that the build reads, such as through third-party modules or shared repositories. Teams that do not use the Terraform hook, or that only build from configuration they fully control, can skip it.","user_interaction":"unknown","needs_special_setup":"yes","severity_if_unknown":"high"},"cost_usd":0.00073,"input_tokens":3900,"output_tokens":679,"severity_before":"unknown"},"analyst_status":null,"analyst_note":null,"search":"'-115414':3A,89C,101C,148C,306C '-145':114C '-2026':2A,88C,100C,147C,305C '..':255C '1.166.1':221C '1.63.0':220C '10/22/2026':125C '11':126C '2026':113C '30':127C '44mq':15A,20A,309C 'acknowledg':312C 'actor':190C 'address':52B,180C,227C 'allow':188C 'applic':143C 'arbitrari':75B,206C 'attack':59B 'attent':122C 'audit':279C 'aw':23B,40B,115C,117C,131C,165C,229C 'aws-security@amazon.com':338C 'build':43B,72B,79B,86B,141C,159C,203C,210C,217C,268C,293C 'bulletin':111C 'causal':323C 'cd':26B 'ci':25B 'ci-cd':24B 'cipher':321C 'cli':10A,33B,42B,96C,108C,133C,167C,231C 'code':247C 'collabor':326C 'come':273C 'command':5A,76B,91C,103C,151C,207C 'concern':344C 'configur':65B,196C,260C 'consum':69B,200C,265C 'content':118C 'coordin':332C 'could':187C 'cve':1A,87C,99C,146C,304C 'date':124C 'deriv':246C 'descript':130C 'disclosur':29B,334C 'email':337C 'ensur':242C,257C 'escap':55B 'execut':205C 'file':68B,199C,261C,264C 'fix':254C,297C 'fork':244C 'framework':139C 'fulli':54B,182C 'generat':171C 'ghsa':14A,19A,308C 'ghsa-44mq-wjrh-vpj6':13A,18A,307C 'hook':12A,38B,98C,110C,157C,161C,170C,270C 'hook-nam':160C,269C 'host':83B,214C 'id':112C 'identifi':145C 'impact':218C 'import':120C 'incorpor':251C 'influenc':62B,193C 'inject':6A,92C,104C,152C 'input':290C 'interpol':48B,176C 'issu':7A,93C,105C,153C,224C,329C 'lab':28B 'lab-disclosur':27B 'latest':239C 'like':315C 'makefil':45B,173C 'metacharact':57B,185C 'modul':284C 'name':162C,271C 'neutral':183C 'new':253C 'open':137C 'open-sourc':136C 'os':4A,90C,102C,150C 'packag':30B 'parti':282C 'patch':249C 'pdt':129C 'plan':67B,198C,263C 'pleas':336C 'process':335C 'public':123C 'question':342C 'raj':319C 'recip':46B,174C 'recommend':235C,301C 'refer':303C 'remedi':302C 'repositori':287C 'requir':121C 'resolut':222C 'resourc':51B,179C 'run':74B,84B,215C 'sam':9A,32B,41B,95C,107C,132C,158C,166C,230C,267C 'sam-c':31B 'scope':116C 'secur':324C,341C 'serverless':34B,142C 'share':286C 'shell':56B,184C 'shubham':318C 'sourc':138C,277C 'suppli':289C 'terraform':11A,35B,37B,50B,64B,97C,109C,156C,163C,169C,178C,195C,259C,272C,283C 'thank':317C 'third':281C 'third-parti':280C 'trust':276C 'type':119C 'upgrad':236C,294C 'user':80B,211C 'v1.166.2':233C 'version':219C,232C,240C,298C 'vpj6':17A,22A,311C 'vulner':333C 'without':53B,181C 'wjrh':16A,21A,310C 'workaround':256C 'would':314C","nicknames":[],"mitigations":[],"who_affected":"Teams that run `sam build --hook-name terraform` on SAM CLI versions from `1.63.0` through `1.166.1` are exposed. The risk depends on whether untrusted parties can influence the Terraform configuration or plan file that the build reads, such as through third-party modules or shared repositories. Teams that do not use the Terraform hook, or that only build from configuration they fully control, can skip it.","tier":"B","verified":{},"analyst_revisit_at":null,"first_public_at":"2026-10-22T00:00:00+00:00","kev":null,"cvss_vector":null,"cvss_by":null,"poc_count":0,"sources":[{"source":"lab","external_id":"https://aws.amazon.com/security/security-bulletins/rss/2026-145-aws/#GHSA-44mq-wjrh-vpj6","url":"https://aws.amazon.com/security/security-bulletins/rss/2026-145-aws/","severity":null,"published_at":"2026-10-22T00:00:00+00:00","modified_at":null,"first_seen_at":"2026-10-24T18:56:54+00:00","fetched_at":"2026-10-24T18:56:54+00:00","note":"AWS: CVE-2026-115414 - OS Command Injection Issue in SAM CLI Terraform Hook"}],"documents":[{"id":2911,"url":"https://aws.amazon.com/security/security-bulletins/rss/2026-145-aws/","title":"AWS: CVE-2026-115414 - OS Command Injection Issue in SAM CLI Terraform Hook","kind":"advisory","source":"lab","text":"CVE-2026-115414 - OS Command Injection Issue in SAM CLI Terraform Hook\n\n### CVE-2026-115414 - OS Command Injection Issue in SAM CLI Terraform Hook\n\nBulletin ID: 2026-145-AWS Scope: AWS Content Type: Important (requires attention) Publication Date: 10/22/2026 11:30 AM PDT\n\nDescription:\n\nAWS SAM CLI is an open-source framework for building serverless applications. We identified CVE-2026-115414, an OS command injection issue in the Terraform hook (sam build --hook-name terraform) in AWS SAM CLI. The Terraform hook generates a Makefile recipe that interpolates a Terraform resource address without fully neutralizing shell metacharacters, which could 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.\n\nImpacted versions: >=1.63.0, <=1.166.1\n\nResolution:\n\nThis issue has been addressed in AWS SAM CLI version v1.166.2. We recommend upgrading to the latest version and ensuring any forked or derivative code is patched to incorporate the new fixes..\n\nWorkarounds:\n\nEnsure that Terraform configuration files and plan files consumed by sam build --hook-name terraform come only from trusted sources, and audit third-party Terraform modules and shared repositories that supply input to the build. Upgrading to a fixed version is the recommended remediation.\n\nReferences:\n\n- CVE-2026-115414\n- GHSA-44mq-wjrh-vpj6\n\nAcknowledgement:\n\nWe would like to thank Shubham Raj of Cipher by Causal Security for collaborating on this issue through the coordinated vulnerability disclosure process.\n\n Please email aws-security@amazon.com with any security questions or concerns.","published_at":"2026-10-22T00:00:00+00:00","relation":"advisory","confidence":null,"note":null}],"notice":"Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai"}