CVE-2024-45037 AWS CDK RestApi not generating authorizationScope correctly in resultant CFN template
AWS CDK users may inadvertently grant Cognito users broader API access than intended due to incorrect authorization scope generation in CloudFormation templates.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2024-45037?
CVE-2024-45037 is a medium-severity missing authorization vulnerability in aws-cdk, published on 27 Aug 2024. Any signed-in user can exploit it over the network, with no action from the victim.
Official description
The AWS Cloud Development Kit (CDK) is an open-source framework for defining cloud infrastructure using code. Customers use it to create their own applications which are converted to AWS CloudFormation templates during deployment to a customer’s AWS account. CDK contains pre-built components called "constructs" that 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. We identified an issue in AWS Cloud Development Kit (CDK) which, under certain conditions, can result in granting authenticated Amazon Cognito users broader than intended access. Specifically, if a CDK application uses the "RestApi" construct with "CognitoUserPoolAuthorizer" as the authorizer and uses authorization scopes to limit access. This issue does not affect the availability of the specific API resources. Authenticated Cognito users may gain unintended access to protected API resources or methods, leading to potential data disclosure, and modification issues. Impacted versions: >=2.142.0;<=2.148.0. A patch is included in CDK versions >=2.148.1. Users are advised to upgrade their AWS CDK version to 2.148.1 or newer and re-deploy their application(s) to address this issue.
Weakness: CWE-863
Which versions are affected by CVE-2024-45037?
2 open source packages ship an affected version, including aws-cdk. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
aws-cdk npm | From 2.142.0 | 2.148.1 |
aws-cdk npm | From 2.142.0 | 2.148.1 |
Products include Amazon Aws Cloud Development Kit.
How do I fix CVE-2024-45037?
Upgrade aws-cdk to 2.148.1 or later.
Upgrade, and check permissions on every request on the server, not only in the interface. More about Missing authorization.
Is CVE-2024-45037 being exploited?
There is no known exploitation of CVE-2024-45037 in the wild and no public exploit code.
Other vulnerabilities in aws-cdk
Sources
Also known as GHSA-qj85-69xf-2vxq.