/

CVE-2026-11417

Severity:

HIGH RISK

(7.3)

OS Command Injection (CWE-78) in AWS CDK NodejsFunction

CVE-2026-11417

Awaiting Analysis

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Arbitrary Command Execution on Build Host

Severity:

HIGH RISK

(7.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

OS command injection in the AWS CDK NodejsFunction local bundling pipeline allows arbitrary commands to be executed on the host running the CDK toolchain when certain bundling properties are attacker-controlled.

If a threat actor can influence values such as externalModules, define, loader, inject, or esbuildArgs in a CDK application, they may inject shell metacharacters and gain code execution during the build process.

Affected context

The vulnerability appears in AWS CDK applications that use the NodejsFunction construct with local bundling enabled.

It becomes relevant in environments where:

  • CDK infrastructure code is collaboratively edited or partially generated from external input, and
  • One or more bundling properties (externalModules, define, loader, inject, esbuildArgs) can be influenced by untrusted or semi-trusted parties.

The issue impacts the machine that runs the CDK toolchain (e.g., developer workstation, CI/CD runner) rather than deployed cloud resources directly.

Exploit preconditions

  • Attack surface: The CDK build and deployment pipeline (local bundling phase of NodejsFunction).
  • Required access: Ability to modify or influence the CDK application's bundling configuration, specifically one or more of:
  • externalModules
  • define
  • loader
  • inject
  • esbuildArgs
  • Trigger point: Execution of cdk synth, cdk deploy, or other commands that trigger NodejsFunction local bundling.
  • Why exploitation is possible: The bundling properties are interpolated into shell commands without adequate sanitization or escaping, allowing shell metacharacters to break out of the intended command structure and inject attacker-controlled commands.

Why this happens

The core issue is unsafe construction of shell commands from data that can be influenced by users or external sources.

In the NodejsFunction local bundling pipeline, values from configuration properties (such as externalModules, define, loader, inject, and esbuildArgs) are incorporated into the command line invoked by the CDK toolchain.

Without strict validation, escaping, or use of safe process-spawning APIs, shell metacharacters in these values can alter command parsing and cause arbitrary commands to run.

This aligns with CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where application-level configuration is treated as trusted and directly embedded into system-level commands.

Potential impact

  • Execution of arbitrary commands on the developer workstation or CI/CD runner.
  • Compromise of credentials, access tokens, or other secrets present in the build environment.
  • Tampering with synthesized infrastructure definitions or build artifacts.
  • Lateral movement from the CI pipeline into other internal systems, depending on network reachability and credentials.
  • Installation of persistent malware or backdoors on build hosts.

General mitigation guidance

Effective mitigation focuses on separating data from shell interpretation and tightening configuration trust boundaries:

  • Use APIs that construct process arguments as arrays rather than concatenated shell strings, avoiding reliance on a shell where possible.
  • Apply strict validation and canonicalization to all bundling properties, rejecting or sanitizing characters and patterns that have special meaning in shells.
  • Treat CDK application configuration (including bundling parameters) as sensitive code, with controlled write access and peer review.
  • Run CDK commands from locked-down environments with least-privilege credentials and minimal access to host resources.
  • Isolate build and deployment environments (for example via containers or dedicated runners) to limit blast radius if command execution occurs.

How teams detect issues like this

Detection can leverage both code-centric and environment-centric approaches:

  • Static analysis rules or linters that flag the use of shell-based command construction with interpolated configuration values in build tooling.
  • Code review checklists that explicitly call out any use of bundling parameters in command strings and ensure they are safely handled.
  • Policy-based checks in CI that scan CDK applications for suspicious bundling configuration values (e.g., presence of shell metacharacters) before running synthesis or deployment.
  • Runtime monitoring of build hosts or CI runners for anomalous process executions spawned during CDK commands, including logging of executed commands and arguments.
  • Use of automated security scanners that understand infrastructure-as-code and build scripts to identify patterns indicative of OS command injection risks.

Sources

SourceLink
aws.amazon.comaws.amazon.com/security/security-bulletins/2026-041-aws/
github.comgithub.com/aws/aws-cdk/releases/tag/v2.245.0
github.comgithub.com/aws/aws-cdk/security/advisories/GHSA-999r-qq7v-r334

Frequently asked

questions

Not directly in the traditional sense; exploitation occurs when a CDK command is run on a host where the attacker has influenced the CDK application's bundling configuration. However, if an attacker can commit or modify CDK code in a shared repository, they may achieve remote code execution on any CI runner or developer machine that uses that repository.

The attacker must be able to control or significantly influence one or more bundling properties (externalModules, define, loader, inject, esbuildArgs) in the CDK application. This could occur through compromised developer accounts, malicious pull requests, or automated code generation that processes untrusted data.

The most robust fix pattern is to avoid constructing shell commands from untrusted or semi-trusted configuration entirely and instead use parameterized process execution APIs that treat arguments as data. Combine this with strict validation of configuration fields and a default-deny approach to characters and patterns that do not belong in these properties.

To prevent similar issues, design build and deployment tooling so that configuration values are never concatenated into shell command strings, enforce strong validation on all user-influenced configuration, and apply rigorous review to any code that bridges application-level configuration with OS-level commands. Embedding security checks into CI and development guidelines for infrastructure-as-code further reduces the likelihood of reintroducing such vulnerabilities.

Find out what's already
exploitable in your codebase.