{"answers":{"affected":"2 open source packages ship an affected version, including aws-cdk-lib.","exploited":"There is no known exploitation of GHSA-5pq3-h73f-66hr in the wild and no public exploit code.","fix":"Upgrade aws-cdk-lib to 2.189.0 or later.","what":"GHSA-5pq3-h73f-66hr is a missing authorization vulnerability in aws-cdk-lib, published on 24 Mar 2025. Any signed-in user can exploit it over the network, with no action from the victim."},"fix_prompt":"Check this codebase for GHSA-5pq3-h73f-66hr and fix it if it is affected.\n\nWhat it is: GHSA-5pq3-h73f-66hr is a missing authorization vulnerability in aws-cdk-lib, published on 24 Mar 2025. Any signed-in user can exploit it over the network, with no action from the victim.\nExploitation: There is no known exploitation of GHSA-5pq3-h73f-66hr in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- aws-cdk-lib (npm): affected all versions; fixed in 2.189.0\n- aws-cdk-lib (npm): affected all versions; fixed in 2.189.0\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-5pq3-h73f-66hr/ (Markdown: https://insights.sbomify.com/GHSA-5pq3-h73f-66hr/index.md)","id":"GHSA-5pq3-h73f-66hr","markdown":"https://insights.sbomify.com/GHSA-5pq3-h73f-66hr/index.md","name":"GHSA-5pq3-h73f-66hr","record":{"aliases":[],"analysis":{"component_type":"developer_tool","fix_type":"patch","impacts":["privilege_escalation","data_read"],"network_reachable":"yes","non_default_config":false,"product_category":"AWS CDK CodePipeline","requires_auth":"low_privilege","summary":"Authenticated users with broad AssumeRole permissions can escalate privileges by assuming overly permissive IAM roles created by AWS CDK CodePipeline constructs.","user_interaction":"not_required","vuln_class":"missing_authorization"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"### 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: \u003cv2.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\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.","ecosystems":["npm"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"AWS CDK CodePipeline: trusted entities are too broad","id":"GHSA-5pq3-h73f-66hr","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"npm","product":null,"products":[],"type":"missing_authorization","year":"2025"},"n_packages":2,"n_references":null,"packages":[{"ecosystem":"npm","fixed":["2.189.0"],"introduced":["0"],"last_affected":[],"package":"aws-cdk-lib","purl":null,"source":"GHSA-5pq3-h73f-66hr"},{"ecosystem":"npm","fixed":["2.189.0"],"introduced":["0"],"last_affected":[],"package":"aws-cdk-lib","purl":"pkg:npm/aws-cdk-lib","source":"GHSA-5pq3-h73f-66hr"}],"products":null,"published":"2025-03-24","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"Authenticated users with broad AssumeRole permissions can escalate privileges by assuming overly permissive IAM roles created by AWS CDK CodePipeline constructs.","url":"https://insights.sbomify.com/GHSA-5pq3-h73f-66hr/"}