GHSA-5PQ3-H73F-66HR

GHSA-5PQ3-H73F-66HR is a low-severity security vulnerability in aws-cdk-lib (npm), affecting versions < 2.189.0. It is fixed in 2.189.0.

Summary

The AWS Cloud Development Kit (CDK) is an open-source framework for defining cloud infrastructure using code. Users use it to create their own applications, which are converted to AWS CloudFormation templates during deployment to a user's AWS account. AWS CDK contains pre-built components called "constructs," which are higher-level abstractions providing defaults and best practices. This approach enables developers to use familiar programming languages to define complex cloud infrastructure more efficiently than writing raw CloudFormation templates.

The AWS CodePipeline construct deploys CodePipeline, a managed service that orchestrates software release processes through a series of stages, each comprising one or more actions executed by CodePipeline. To perform these actions, CodePipeline assumes IAM roles with permissions necessary for each step, allowing it to interact with AWS services and resources on behalf of the user.

An issue exists where, when using CDK to create a CodePipeline with the CDK Construct Library, CDK creates an AWS Identity and Access Management (AWS IAM) trust policy with overly broad permissions. Any user with unrestricted sts:AssumeRole permissions could assume that trust policy. This issue does not affect users who supply their own role for CodePipeline.

Impacted versions: <v2.189.0

Workarounds

You can explicitly supply the role for your CodePipeline and follow the policy recommendations detailed in CodePipeline documentation.

References

Original reporting issue.

If you have any questions or comments about this advisory please contact AWS/Amazon Security via our vulnerability reporting page or directly via email to [email protected]. Please do not create a public GitHub issue.

Impact

To leverage the issue, an actor has to be authenticated in the account and have an unrestricted sts:AssumeRole permission. The permissions an actor could leverage depend on the actions added to the pipeline. Possible permissions include actions on services such as CloudFormation, CodeCommit, Lambda, and ECS, as well as access to the S3 bucket holding pipeline build artifacts (see documentation).

Users can review their AWS CloudTrail logs for when the role was assumed to determine if this was expected.

GHSA-5PQ3-H73F-66HR has a CVSS score of 3.8 (Low). The vector is network-reachable, high privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (2.189.0); upgrading removes the vulnerable code path.

Affected versions

aws-cdk-lib (< 2.189.0)

Security releases

aws-cdk-lib → 2.189.0 (npm)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

See it in your environment

Remediation advice

The patches are included in the CDK Construct Library release v2.189.0. We recommend upgrading to the latest version and ensuring any forked or derivative code is patched to incorporate the new fixes.

When new CDK applications using the latest version are initialized, they will use the new behavior with more restrictive permissions.

Existing applications must upgrade to the latest version, change the feature flag (@aws-cdk/pipelines:reduceStageRoleTrustScope) and (@aws-cdk/pipelines:reduceCrossAccountActionRoleTrustScope) to true and redeploy the application to apply this fix and use the new behavior with more restrictive permissions.

Frequently Asked Questions

  1. What is GHSA-5PQ3-H73F-66HR? GHSA-5PQ3-H73F-66HR is a low-severity security vulnerability in aws-cdk-lib (npm), affecting versions < 2.189.0. It is fixed in 2.189.0.
  2. How severe is GHSA-5PQ3-H73F-66HR? GHSA-5PQ3-H73F-66HR has a CVSS score of 3.8 (Low). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which versions of aws-cdk-lib are affected by GHSA-5PQ3-H73F-66HR? aws-cdk-lib (npm) versions < 2.189.0 is affected.
  4. Is there a fix for GHSA-5PQ3-H73F-66HR? Yes. GHSA-5PQ3-H73F-66HR is fixed in 2.189.0. Upgrade to this version or later.
  5. Is GHSA-5PQ3-H73F-66HR exploitable, and should I be worried? Whether GHSA-5PQ3-H73F-66HR is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether GHSA-5PQ3-H73F-66HR is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix GHSA-5PQ3-H73F-66HR? Upgrade aws-cdk-lib to 2.189.0 or later.

Other vulnerabilities in aws-cdk-lib

Stop the waste.
Protect your environment with Kodem.