CVE-2026-13760: OS Command Injection in aws-cdk-lib Docker Bundling

Published Jul 1, 2026
·
Updated

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.

Other sources

OS command injection in the NodejsFunction Docker bundling pipeline (OsCommand helper) in AWS aws-cdk-lib on all platforms might allow a 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.

To remediate this issue, users should upgrade to v2.260.0.

NVD

Affected Software

2 affected componentsFixes available
AWS aws-cdk-lib<2.260.0
npm/aws-cdk-lib<2.260.0
2.260.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/aws-cdk-lib to a version that resolves this vulnerability.

    Fixed in 2.260.0
  2. Upgrade

    Upgrade AWS CDK (aws-cdk-lib) to a version that resolves this vulnerability.

    Fixed in 2.260.0
  3. Compensating control

    Use local bundling instead of Docker-based bundling to avoid the affected NodejsFunction Docker bundling code path when using the nodeModules bundling option.

  4. Compensating control

    Ensure that the modules listed in the nodeModules bundling option and the version strings declared for them in your project's package.json (and the versions of the corresponding installed packages) come only from trusted sources; audit third-party constructs and dependencies that introduce them.

Event History

Jul 1, 2026
CVE Published
via MITRE·07:05 PM
Data Sourced
via MITRE·07:05 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·07:16 PM
DescriptionSeverityWeakness
Jul 21, 2026
Advisory Published
via GitHub·07:04 PM
Data Sourced
via GitHub·07:04 PM
DescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-13760?

The severity of CVE-2026-13760 is rated as high, with a CVSS score of 7.3.

2

What type of vulnerability is CVE-2026-13760?

CVE-2026-13760 is an OS command injection vulnerability affecting the aws-cdk-lib.

3

How can CVE-2026-13760 be mitigated?

To mitigate CVE-2026-13760, ensure that dependency version strings in package.json are controlled and sanitized.

4

Who is affected by CVE-2026-13760?

CVE-2026-13760 affects any user of the AWS aws-cdk-lib who employs Docker bundling with NodejsFunction.

5

What should I do if I discover a vulnerable version related to CVE-2026-13760?

If you discover a vulnerable version related to CVE-2026-13760, update to the latest version of the AWS aws-cdk-lib as recommended in the security advisories.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203