CVE-2026-11417: aws-cdk-lib OS Command Injection Vulnerability

HIGH
Advisory Identifier: GHSA-999r-qq7v-r334
CVSS 7.3
CWE-78
Published
Advisory Summary

CVE-2026-11417 is a HIGH (CVSS 7.3) os command injection vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting aws-cdk-lib libraries in the npm ecosystem. The issue involves os command injection in nodejsfunction bundling. Remediation is available by upgrading affected packages to version 2.246.0.

CVE-2026-11417 at a Glance

CVE Identifier CVE-2026-11417
GHSA Identifier GHSA-999r-qq7v-r334
Severity HIGH
CVSS v3.1 Base Score 7.3
CWE Classification CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
Affected Product aws-cdk-lib
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-11417

To remediate this vulnerability, upgrade all affected aws-cdk-lib dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

aws-cdk-lib fixed: 2.246.0
npm install aws-cdk-lib@2.246.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls aws-cdk-lib

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-11417, inspect your project dependencies using npm:

npm ls aws-cdk-lib

Analyze the terminal output to locate any version of aws-cdk-lib in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.246.0), your application is affected.

Note: The npm ls aws-cdk-lib command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In aws-cdk-lib, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary AWS CDK (`aws-cdk-lib`) is an open-source framework for defining cloud infrastructure in code and provisioning it through AWS CloudFormation. OS command injection in the `NodejsFunction` local bundling pipeline in `aws-cdk-lib` before 2.245.0 (2.246.0 on Windows) might allow a threat actor who controls the value of one or more bundling properties (`externalModules`, `define`, `loader`, `inject`, or `esbuildArgs`) to execute arbitrary commands on the host running the CDK toolchain via injected shell metacharacters. This issue requires the threat actor to control the value of one or more of the affected bundling properties in the CDK application. ### Impact During local Lambda bundling, `NodejsFunction` assembled an esbuild command string from the bundling properties `externalModules`, `define`, `loader`, `inject`, and `esbuildArgs` and executed it via a shell (`bash -c` on Linux/macOS, `cmd /c` on Windows) through `spawnSync`. The property values were interpolated without escaping or validation, so values containing shell metacharacters could execute arbitrary commands with the privileges of the user running `cdk synth`, `cdk deploy`, or `cdk diff`. Exploitation requires a threat actor to control one or more of the affected property values in the CDK application — for example via an untrusted npm dependency that vends a wrapper construct, or via a pull request that introduces untrusted values. ### Impacted versions: < 2.245.0 (on Windows, < 2.246.0) ### Patches This issue has been addressed in `aws-cdk-lib` version 2.245.0 (PR #37292), with a Windows-specific regression fix in 2.246.0 (PR #37412). The fix replaces shell-based command execution with array-based `spawnSync` invocation that does not invoke a shell. We recommend upgrading to the latest version and ensuring any forked or derivative code is patched to incorporate the new fixes. ### Workarounds Ensure the values supplied to `NodejsFunction` bundling properties (`externalModules`, `define`, `loader`, `inject`, `esbuildArgs`) originate only from trusted sources, and audit third-party constructs and pull requests that set them. Upgrading to a fixed version is the recommended remediation. ### References If you have any questions or comments about this advisory, we ask that you contact AWS Security via our [vulnerability reporting page](https://aws.amazon.com/security/vulnerability-reporting) or directly via email to [aws-security@amazon.com](mailto:aws-security@amazon.com). Please do not create a public GitHub issue. ### Acknowledgement AWS would like to thank the external researcher Hesham Ashraf who reported this issue through the AWS Vulnerability Disclosure Program (HackerOne) for collaborating on it through the coordinated vulnerability disclosure process.

CVE-2026-11417 Affected aws-cdk-lib Versions

1 component(s)
Fixed Versions:
2.246.0
Product / Package Ecosystem Affected Versions Fixed Version
aws-cdk-lib
npm
< 2.246.0
2.246.0

References

Frequently Asked Questions

What is CVE-2026-11417?
CVE-2026-11417 is a security vulnerability in aws-cdk-lib involving OS Command Injection in NodejsFunction Bundling under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').
Which aws-cdk-lib versions are affected?
Affected versions include releases prior to 2.246.0 across affected packages: aws-cdk-lib.
What version fixes CVE-2026-11417?
Upgrading to 2.246.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is aws-cdk-lib affected?
Yes, aws-cdk-lib is affected in releases prior to 2.246.0. Upgrade your dependency to 2.246.0 or later.
What is the CVSS score of CVE-2026-11417?
CVE-2026-11417 has a CVSS v3.1 base score of 7.3 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-11417?
CVE-2026-11417 is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') (The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.).
How can I check npm dependencies for CVE-2026-11417?
Run the dependency tree command: 'npm ls aws-cdk-lib'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-999r-qq7v-r334",
  "modified" : "2026-06-15T20:47:36Z",
  "published" : "2026-06-15T20:47:36Z",
  "aliases" : [ "CVE-2026-11417" ],
  "summary" : "aws-cdk-lib: OS Command Injection in NodejsFunction Bundling",
  "details" : "### Summary\nAWS CDK (`aws-cdk-lib`) is an open-source framework for defining cloud infrastructure in code and provisioning it through AWS CloudFormation. OS command injection in the `NodejsFunction` local bundling pipeline in `aws-cdk-lib` before 2.245.0 (2.246.0 on Windows) might allow a threat actor who controls the value of one or more bundling properties (`externalModules`, `define`, `loader`, `inject`, or `esbuildArgs`) to execute arbitrary commands on the host running the CDK toolchain via injected shell metacharacters. This issue requires the threat actor to control the value of one or more of the affected bundling properties in the CDK application.\n\n### Impact\nDuring local Lambda bundling, `NodejsFunction` assembled an esbuild command string from the bundling properties `externalModules`, `define`, `loader`, `inject`, and `esbuildArgs` and executed it via a shell (`bash -c` on Linux/macOS, `cmd /c` on Windows) through `spawnSync`. The property values were interpolated without escaping or validation, so values containing shell metacharacters could execute arbitrary commands with the privileges of the user running `cdk synth`, `cdk deploy`, or `cdk diff`. Exploitation requires a threat actor to control one or more of the affected property values in the CDK application — for example via an untrusted npm dependency that vends a wrapper construct, or via a pull request that introduces untrusted values.\n\n### Impacted versions: \n< 2.245.0 (on Windows, < 2.246.0)\n\n### Patches\nThis issue has been addressed in `aws-cdk-lib` version 2.245.0 (PR #37292), with a Windows-specific regression fix in 2.246.0 (PR #37412). The fix replaces shell-based command execution with array-based `spawnSync` invocation that does not invoke a shell. We recommend upgrading to the latest version and ensuring any forked or derivative code is patched to incorporate the new fixes.\n\n### Workarounds\nEnsure the values supplied to `NodejsFunction` bundling properties (`externalModules`, `define`, `loader`, `inject`, `esbuildArgs`) originate only from trusted sources, and audit third-party constructs and pull requests that set them. Upgrading to a fixed version is the recommended remediation.\n\n### References\nIf you have any questions or comments about this advisory, we ask that you contact AWS Security via our [vulnerability reporting page](https://aws.amazon.com/security/vulnerability-reporting) or directly via email to [aws-security@amazon.com](mailto:aws-security@amazon.com). Please do not create a public GitHub issue.\n\n### Acknowledgement \nAWS would like to thank the external researcher Hesham Ashraf who reported this issue through the AWS Vulnerability Disclosure Program (HackerOne) for collaborating on it through the coordinated vulnerability disclosure process.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "aws-cdk-lib"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.246.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/aws/aws-cdk/security/advisories/GHSA-999r-qq7v-r334"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-11417"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/aws/aws-cdk/pull/37292"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/aws/aws-cdk/pull/37412"
  }, {
    "type" : "WEB",
    "url" : "https://aws.amazon.com/security/security-bulletins/2026-041-aws"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/aws/aws-cdk"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/aws/aws-cdk/releases/tag/v2.245.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-78" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-15T20:47:36Z",
    "nvd_published_at" : "2026-06-10T18:16:39Z"
  }
}