High

aws-cdk-lib: OS Command Injection in NodejsFunction Docker Bundling

  • Disclosed: 21.07.2026
  • Updated: 11.10.2026 10:22

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 issue in the NodejsFunction Docker bundling pipeline in aws-cdk-lib before 2.260.0 that might allow an actor who controls dependency version strings in a project's package.json file to execute arbitrary commands on the host running the CDK toolchain via injected shell metacharacters in the OsCommand helper. This issue requires the actor to control the content of a package.json dependency version string that is processed during Docker-based bundling with nodeModules specified.

Impact

During Docker-based Lambda bundling, when the nodeModules option is specified, NodejsFunction assembled a shell command string, including file-operation commands generated by an internal OsCommand helper, from the version strings of the modules listed in nodeModules, and executed it via a shell (bash -c) inside the bundling container. These version strings were interpolated without shell escaping, so values containing shell metacharacters could execute arbitrary commands inside the bundling container - which has read/write bind mounts to the host filesystem - with the privileges of the user running cdk synth, cdk deploy, or cdk diff. Leveraging this issue requires an actor to control a dependency version string for one of the listed modules - for example via an untrusted npm package referenced through nodeModules.

Impacted versions:

< 2.260.0

Patches

This issue has been addressed in aws-cdk-lib version 2.260.0 (PR #38133). We recommend upgrading to the latest version and ensuring any forked or derivative code is patched to incorporate the new fixes.

Workarounds

Ensure that the modules listed in the nodeModules bundling option - and the version strings declared for them in your project's package.json, as well as the versions of the corresponding installed packages - come only from trusted sources, and audit third-party constructs and dependencies that introduce them. Using local bundling instead of Docker-based bundling avoids the affected code path. 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 or directly via email to aws-security@amazon.com. Please do not create a public GitHub issue.

Acknowledgement

We would like to thank the external researcher Mostafa Ashraf who reported this issue through the AWS Vulnerability Disclosure Program (HackerOne @kaporia) for collaborating on it through the coordinated vulnerability disclosure process.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
npm package aws-cdk-lib < 2.260.0 2.260.0

References

CVSS score 7.3/10
CVSS vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H
Weakness (CWE)
CWE-78
Platform
npm
Package
aws-cdk-lib
Disclosed
21.07.2026
Updated
11.10.2026 10:22

Sources and licenses

OSV / GitHub Advisory Database - GHSA-vcrf-j523-4mrf - CC BY 4.0

Vulnerability history: aws-cdk-lib

All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
8
First → latest
06.2023 07.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • High 2
  • Medium 2
  • Low 4

Disclosures per year

  1. 2023: 1
  2. 2024: 0
  3. 2025: 4
  4. 2026: 3
  1. Low · 3.3 ghsa-464c-974j-9xm6 < 2.253.0 2.253.0
  2. aws-cdk-lib: OS Command Injection in NodejsFunction Docker Bundling this entry
    High · 7.3 CVE-2026-13760 < 2.260.0 2.260.0
  3. High · 7.3 CVE-2026-11417 < 2.246.0 2.246.0
  4. Low · 2.2 ghsa-qc59-cxj2-c2w4 >= 2.172.0, < 2.189.1 2.189.1
  5. Low · 3.8 ghsa-5pq3-h73f-66hr < 2.189.0 2.189.0
  6. Medium · 6.6 CVE-2023-35165 >= 2.0.0, < 2.80.0 2.80.0

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.