GHSA-qc59-cxj2-c2w4: aws-cdk-lib's aspect order change causes different Permissions Boundary assigned to Role
Noroxi assessment
Priority: Monitor (action score 8/100)
- The sources we track (CISA KEV, Exploit-DB, Metasploit, Nuclei, GitHub) show no public exploit code or exploitation in the wild.
- Anyone who can reach it over the internet can trigger it. Administrator privileges are required. No user action is required. Special conditions such as timing or configuration are required.
- Fixed version: aws-cdk-lib (npm) 2.189.1.
Low priority for now. Upgrade to aws-cdk-lib (npm) 2.189.1 or later.
Generated automatically from the record's data: CVSS (NVD and CNA), CISA KEV and SSVC, FIRST EPSS, exploit sources, fixed versions. How we calculate it
Primary sources: OSV
### Summary The [AWS Cloud Development Kit (AWS CDK)](https://aws.amazon.com/cdk/) is an open-source software development framework for defining cloud infrastructure in code and provisioning it through AWS CloudFormation. In the CDK, developers organize their applications into reusable components called "[constructs](https://docs.aws.amazon.com/cdk/v2/guide/constructs.html)," which are organized into a hierarchical tree structure. One of the features of this framework is the ability to call "[Aspects](https://docs.aws.amazon.com/cdk/v2/guide/aspects.html)," which are mechanisms to set configuration options for all AWS Resources in a particular part of the hierarchy at once. Aspect execution happens in a specific order, and the last Aspect to execute controls the final values in the template. AWS CDK version [2.172.0](https://github.com/aws/aws-cdk/releases/tag/v2.172.0) introduced a new priority system for Aspects. Prior to this version, CDK would run Aspects based on hierarchical location. The new priority system takes precedence over hierarchical location, altering the invocation order of Aspects. Different priority classes were introduced: Aspects added by CDK APIs were classified as MUTATING (priority 200), while Aspects added directly by the user were classified as DEFAULT (priority 500) unless the user specified otherwise. As a result of this change, CDK apps that use a custom Aspect to assign a default permissions boundary and then use a built-in CDK method to override it on select resources could have unexpected permissions boundaries assigned. The following is an affected code sample: ```ts Aspects.of(stack).add(new CustomAspectThatAssignsDefaultPermissionsBoundaries()); // {1} PermissionsBoundary.of(lambdaFunc).apply(...); // {2} -- uses Aspects internally ``` In versions prior to 2.172.0, the Aspect added by {2} would invoke last and assign its permissions boundary to the Lambda function role. In versions 2.172.0 and after, the Aspect added by {2} would have priority 200 while the Aspect added by {1} would have priority 500 and therefore be invoked last. The Lambda function role would get the permissions boundary of {1} assigned, which may not be what users expect. ### Impact If an unexpected permissions boundary is selected for a role, it could lead to that role having insufficient permissions. Alternatively, this could lead to a role having wider permissions than intended; however, this could happen only in combination with an overly permissive role policy, as permissions boundaries do not grant permissions by themselves. Impacted versions: versions 2.172.0 up until 2.189.1 ### Patches In version 2.189.1, the behavior has been reverted to the behavior of pre-2.172.0. The new behavior is available through a feature flag: ```json { "context": { "@aws-cdk/core:aspectPrioritiesMutating": true } } ``` The patches are included in AWS CDK Library version 2.189.1 and after. We recommend upgrading to the latest version and ensuring any forked or derivative code is patched to incorporate the new fixes. ### Workarounds As a workaround, users can use the location hierarchy to order the invocation of Aspects. To do this, users can assign the custom Aspect a priority of MUTATING to ensure it has the same priority as the Aspect added by the CDK API, and that the location hierarchy is used for the order of invocation Aspects. The following code is an example: ```ts Aspects.of(stack).add(new CustomAspectThatAssignsDefaultPermissionsBoundaries(), { priority: AspectPriority.MUTATING, }); ``` ### References If you have any questions or comments about this advisory, we ask that you 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. ### Credit We would like to thank GoDaddy for collaborating on this issue through the coordinated vulnerability disclosure process.
- Published
- Apr 15, 2025
- Updated
- Apr 15, 2025
- EPSS
- —
- CWE
- CWE-279
Report tools
Action score
8
Low priority for now.
- CVSS
- 8 / 40 · 2.2 / 10
- CISA KEV
- 0 / 30 · Not listed
- EPSS
- 0 / 30 · —
Get told when this record changes
- Not in KEV: no record of exploitation in the wild
- No public exploit code on record
- A fix has been released
If any of these changes, we'll tell you in the daily email digest.
Is your version affected? Check itNoroxi analysis
What does it mean in your environment?
The assessment above is generated automatically from the record's data; it doesn't know your environment. Our team verifies on your systems whether this vulnerability is actually exploitable and which mitigation is enough.
We use this product, ask for helpAffected systems
Is your version affected?
Pick the product and type the version you run. It's compared with this record's version ranges in your browser; the version isn't sent anywhere.
| Vendor | Product | CPE |
|---|---|---|
| npm | aws-cdk-lib | pkg:npm/aws-cdk-lib |
Package-level exposure
OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.
| Ecosystem | Package | Affected range | Fix |
|---|---|---|---|
| npm | aws-cdk-lib | from 2.172.0 · before 2.189.1 | 2.189.1 |
Same product
npm: all recordsOther highest-scoring records for the same primary product.
- GHSA-qq4x-c6h6-rfxhaws-cdk-lib has Insertion of Sensitive Information into Log File vulnerability when using Cognito UserPoolClient Construct26Monitor
- GHSA-5pq3-h73f-66hrAWS CDK CodePipeline: trusted entities are too broad15Monitor
- GHSA-464c-974j-9xm6AWS CDK CodeBuild S3 Log Encryption Boolean Inversion13Monitor
Remediation
Which version to upgrade to
Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.
| Product / package | Fixed version | Source |
|---|---|---|
| npm:aws-cdk-lib | 2.189.1 | Package registry (OSV) |
Exploit status
No known public exploit
No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.
Research context
For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.
Timeline
From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.
No dated events beyond publication.
Patch and commit links
Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.
Not on record for this CVE: EPSS history · researcher credit · variant or chain candidate · public bounty program.
Technical details
Attack conditions
- Anyone who can reach it over the internet can trigger it.
- Administrator privileges are required.
- No user action is required.
- Special conditions such as timing or configuration are required.
If successful
- Confidentiality
- none
- Integrity
- none
- Availability
- low · the service can be disrupted
- Attack vector
- Network
- Attack complexity
- High
- Privileges required
- High
- User interaction
- None
- Scope
- Unchanged
- Confidentiality impact
- None
- Integrity impact
- None
- Availability impact
- Low
Weakness class (CWE)
CWE-279 · Incorrect Execution-Assigned PermissionsCVSS vector
CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:N/I:N/A:L
osv
Attack context
MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.
Attack patterns (CAPEC)
ATT&CK techniques
—
Change log (1)
- Fix✗ → ✓
For records you follow, these changes also arrive as notifications. →
References
Show all references (3 more)Show less
Vendor advisories and official records. Exploit/PoC links are deliberately left out.