CVE-2024-45037: AWS CDK RestApi incorrect authorization scope in Cognito authorizer

CVE-2024-45037 · Severity: low · CVSS 3.1 · Published 2024-08-27

AWS CDK is a framework for defining cloud infrastructure using code. When developers use CDK's RestApi construct with Cognito authentication and authorization scopes, a flaw can cause the generated CloudFormation template to grant authenticated users broader access than intended. This could allow users to access or modify API data they should not be able to reach.

Technologies: AWS CDK. Vendors: AWS, npm.

Quick answers

Is CVE-2024-45037 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2024-45037 being exploited in the wild.
How severe is CVE-2024-45037?
Low severity, with a CVSS score of 3.1, published 27 August 2024.
Which products and versions are affected?
AWS CDK >=2.142.0, <=2.148.0; aws-cdk (npm) SEMVER:introduced=2.142.0,fixed=2.148.1.
Is there a fix for CVE-2024-45037?
Yes. aws-cdk (npm): upgrade to 2.148.1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2024-45037 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2024-45037?
Check whether you run AWS CDK or aws-cdk (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • aws-cdk (npm): upgrade to 2.148.1 or later
    npm install aws-cdk@2.148.1

Technical details

The vulnerability exists in AWS CDK versions 2.142.0 through 2.148.0 and is classified as incorrect authorization (CWE-863). When the RestApi construct is used with CognitoUserPoolAuthorizer and authorization scopes are configured to restrict access, the authorization scope is not correctly written to the resulting CloudFormation template. Authenticated Cognito users can then bypass the intended scope restrictions and gain access to protected API resources or methods. The vulnerability requires the RestApi construct, CognitoUserPoolAuthorizer, and authorization scopes to all be present in the application. Patching is available in version 2.148.1 and later.

Affected products

  • AWS CDK >=2.142.0, <=2.148.0

Identifiers

  • CVE-2024-45037
  • GHSA-qj85-69xf-2vxq

Timeline

  • 2024-08-27: disclosed
  • 2024-08-27: patched: Patch released in CDK 2.148.1

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.