GHSA-5pq3-h73f-66hr: AWS CDK CodePipeline Trusted Entities Are Too Broad Vulnerability
LOWGHSA-5pq3-h73f-66hr is a LOW (CVSS 3.8) trusted entities are too broad vulnerability (CWE-276: Incorrect Default Permissions) affecting AWS CDK CodePipeline libraries in the npm ecosystem. The issue involves trusted entities are too broad. Remediation is available by upgrading affected packages to version 2.189.0.
GHSA-5pq3-h73f-66hr at a Glance
Security Impact
CVSS: 3.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:L/A:N).
How to Fix GHSA-5pq3-h73f-66hr
To remediate this vulnerability, upgrade all affected AWS CDK CodePipeline dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install aws-cdk-lib@2.189.0
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 GHSA-5pq3-h73f-66hr, inspect your project dependencies using npm:
npm ls aws-cdk-lib
Analyze the terminal output to locate any version of AWS CDK CodePipeline in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.189.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-276: Incorrect Default Permissions, where during installation, installed file permissions are set to allow anyone to modify those files. In AWS CDK CodePipeline, 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
GHSA-5pq3-h73f-66hr Affected AWS CDK CodePipeline Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
aws-cdk-lib
|
npm |
< 2.189.0
|
2.189.0
|
References
Frequently Asked Questions
What is GHSA-5pq3-h73f-66hr?
Which AWS CDK CodePipeline versions are affected?
What version fixes GHSA-5pq3-h73f-66hr?
Is aws-cdk-lib affected?
What is the CVSS score of GHSA-5pq3-h73f-66hr?
What CWE is associated with GHSA-5pq3-h73f-66hr?
How can I check npm dependencies for GHSA-5pq3-h73f-66hr?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-5pq3-h73f-66hr",
"modified" : "2025-04-10T02:02:59Z",
"published" : "2025-03-24T15:45:39Z",
"aliases" : [ ],
"summary" : "AWS CDK CodePipeline: trusted entities are too broad",
"details" : "### Summary\n\nThe [AWS Cloud Development Kit (CDK)](https://aws.amazon.com/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.\n\nThe [AWS CodePipeline](https://aws.amazon.com/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.\n\nAn 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.\n\n### Impact\nTo 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](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codepipeline_actions-readme.html)). \n\nUsers can review their AWS CloudTrail logs for when the role was assumed to determine if this was expected. \n\n#### Impacted versions: <v2.189.0\n\n### Patches\nThe patches are included in the CDK Construct Library release [v2.189.0](https://github.com/aws/aws-cdk/releases/tag/v2.189.0). We recommend upgrading to the latest version and ensuring any forked or derivative code is patched to incorporate the new fixes. \n\nWhen new CDK applications using the latest version are initialized, they will use the new behavior with more restrictive permissions.\n\nExisting applications must upgrade to the latest version, change the [feature flag](https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md) (@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.\n\n### Workarounds\nYou can explicitly supply the role for your [CodePipeline](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codepipeline-readme.html#cross-account-codepipelines) and follow the policy recommendations detailed in [CodePipeline documentation](https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-create-cross-account.html).\n\n### References\n[Original reporting issue.](https://github.com/aws/aws-cdk/issues/33709)\n\n\n\nIf you have any questions or comments about this advisory please contact AWS/Amazon 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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "aws-cdk-lib"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.189.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/aws/aws-cdk/security/advisories/GHSA-5pq3-h73f-66hr"
}, {
"type" : "WEB",
"url" : "https://github.com/aws/aws-cdk/issues/33709"
}, {
"type" : "WEB",
"url" : "https://github.com/aws/aws-cdk/commit/a64b01cc2969822bb92d7bd72152ecb2ccf1c1cf"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/aws/aws-cdk"
}, {
"type" : "WEB",
"url" : "https://github.com/aws/aws-cdk/releases/tag/v2.184.0"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-276" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2025-03-24T15:45:39Z",
"nvd_published_at" : null
}
}