CVE-2024-45037: Aws cdk AWS CDK RestApi Not Generating Vulnerability
MODERATECVE-2024-45037 is a MODERATE (CVSS 6.4) aws cdk restapi not generating vulnerability (CWE-863: Incorrect Authorization) affecting Aws cdk libraries in the npm ecosystem. The issue involves aws cdk restapi not generating authorizationscope correctly in resultant cfn template. Remediation is available by upgrading affected packages to version 2.148.1.
CVE-2024-45037 at a Glance
Security Impact
CVSS: 6.4
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N).
How to Fix CVE-2024-45037
To remediate this vulnerability, upgrade all affected Aws cdk 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@2.148.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls aws-cdk
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2024-45037, inspect your project dependencies using npm:
npm ls aws-cdk
Analyze the terminal output to locate any version of Aws cdk in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.148.1), your application is affected.
Note: The npm ls aws-cdk 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-863: Incorrect Authorization, where the product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. In Aws cdk, 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
CVE-2024-45037 Affected Aws cdk Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
aws-cdk
|
npm |
≥ 2.142.0
< 2.148.1
|
2.148.1
|
References
Frequently Asked Questions
What is CVE-2024-45037?
Which Aws cdk versions are affected?
What version fixes CVE-2024-45037?
Is aws-cdk affected?
What is the CVSS score of CVE-2024-45037?
What CWE is associated with CVE-2024-45037?
How can I check npm dependencies for CVE-2024-45037?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-qj85-69xf-2vxq",
"modified" : "2024-08-28T20:06:12Z",
"published" : "2024-08-27T19:53:21Z",
"aliases" : [ "CVE-2024-45037" ],
"summary" : "AWS CDK RestApi not generating authorizationScope correctly in resultant CFN template",
"details" : "### Summary\nThe 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. \n\nWe 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. \n\n### Impact\nAuthenticated Cognito users may gain unintended access to protected API resources or methods, leading to potential data disclosure, and modification issues. \n\nImpacted versions: >=2.142.0;<=2.148.0\n\n### Patches\nThe patch is included in CDK version >=2.148.1.\n\n### Recommended Actions\n* Upgrade your AWS CDK version to 2.148.1 or newer and re-deploy your application(s) to address this issue.\n* If you are using older CDK versions before 2.142.0, you are not affected by this issue, however it is recommended to upgrade to the latest version to receive the latest features and fixes.\n* Confirm whether your application(s) is affected by searching for \"CognitoUserPoolsAuthorizer\" in your CDK application. If it is referenced inside the \"RestApi\" construct, and the \"RestApi\" resource or method utilize authorization scopes to limit access, and you deployed your applications using the impacted versions of CDK, your application is affected.\n\n\n\n### References\n* AWS CDK Documentation: https://docs.aws.amazon.com/cdk/v2/guide/home.html\n* AWS CDK RestApi Construct Documentation: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-[lib.aws](http://lib.aws/)_apigateway.RestApi.html\n* AWS CDK CognitoUserPoolsAuthorizer Documentation: https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk- [lib.aws](http://lib.aws/)_apigateway.CognitoUserPoolsAuthorizer.html \n* AWS CDK v2.148.1 Release Notes: https://github.com/aws/aws-cdk/releases/tag/v2.148.1\n\nIf you have any questions or comments about this advisory we ask that you contact AWS/Amazon Security via our vulnerability reporting page [1] or directly via email to [aws-security@amazon.com](mailto:aws-security@amazon.com). Please do not create a public GitHub issue.\n\n[1] Vulnerability reporting page: https://aws.amazon.com/security/vulnerability-reporting\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "aws-cdk"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.142.0"
}, {
"fixed" : "2.148.1"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 2.148.0"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/aws/aws-cdk/security/advisories/GHSA-qj85-69xf-2vxq"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-45037"
}, {
"type" : "WEB",
"url" : "https://github.com/aws/aws-cdk/commit/4bee768f07e73ab5fe466f9ad3d1845456a0513b"
}, {
"type" : "WEB",
"url" : "https://docs.aws.amazon.com/cdk/v2/guide/home.html"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/aws/aws-cdk"
}, {
"type" : "WEB",
"url" : "https://github.com/aws/aws-cdk/releases/tag/v2.148.1"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-863" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-08-27T19:53:21Z",
"nvd_published_at" : "2024-08-27T19:15:17Z"
}
}