Miggo Logo

CVE-2024-45037: AWS CDK RestApi not generating authorizationScope correctly in resultant CFN template

6.4

CVSS Score
3.1

Basic Information

EPSS Score
0.37257%
Published
8/27/2024
Updated
8/28/2024
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
aws-cdknpm>= 2.142.0, <= 2.148.02.148.1

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from improper handling of authorization type resolution in the Method class constructor. The commit diff shows a critical change from using AuthorizationTypeOption to AuthorizationType for scope validation. In vulnerable versions, when developers didn't explicitly set authorizationType in method options, the CDK failed to inherit Cognito authorization scopes from the RestApi construct due to using the un-resolved AuthorizationTypeOption. This resulted in missing AuthorizationScopes in CloudFormation templates, granting broader access than intended. The patch directly modifies this logic in method.ts, and new test cases in method.test.ts validate() the correct scope propagation.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

### Summ*ry T** *WS *lou* **v*lopm*nt Kit (**K) is *n op*n-sour** *r*m*work *or ***inin* *lou* in*r*stru*tur* usin* *o**. *ustom*rs us* it to *r**t* t**ir own *ppli**tions w*i** *r* *onv*rt** to *WS *lou**orm*tion t*mpl*t*s *urin* **ploym*nt to * *us

Reasoning

T** vuln*r**ility st*ms *rom improp*r **n*lin* o* *ut*oriz*tion typ* r*solution in t** M*t*o* *l*ss *onstru*tor. T** *ommit *i** s*ows * *riti**l ***n** *rom usin* *ut*oriz*tionTyp*Option to *ut*oriz*tionTyp* *or s*op* v*li**tion. In vuln*r**l* v*rsi