GHSA-qq4x-c6h6-rfxh: aws-cdk-lib has Insertion of Sensitive Information into Log File vulnerability when using Cognito UserPoolClient Construct
Noroxi assessment
Priority: Monitor (action score 26/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. A low-privileged account is enough. No user action is required. No special conditions are required; it is repeatable.
- Fixed version: aws-cdk-lib (npm) 2.187.0.
Low priority for now. Upgrade to aws-cdk-lib (npm) 2.187.0 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 (CDK)](https://aws.amazon.com/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](https://docs.aws.amazon.com/cdk/v2/guide/constructs.html)" 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. The CDK [Cognito UserPool](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.UserPool.html) construct deploys an AWS cognito user pool. An [Amazon Cognito user pool](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools.html) is a user directory for web and mobile app authentication and authorization. Customers can deploy a client under this user pool through construct ‘[UserPoolClient](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.UserPoolClient.html)’ or through helper method '[addClient](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cognito.UserPool.html#addwbrclientid-options)'. A user pool client resource represents an Amazon [Cognito user pool client](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-client-apps.html) which is a configuration within a user pool that interacts with one mobile or web application authenticating with Amazon Cognito. When users of the 'cognito.UserPoolClient' construct generate a secret value for the application client in AWS CDK, they can then reference the generated secrets in their stack. The CDK had an issue where, when the custom resource performed an SDK API call to 'DescribeCognitoUserPoolClient' to retrieve the generated secret, the full response was logged in the associated lambda function's log group. Any user authenticated in the account where logs of the custom resource are accessible and who has read-only permission could view the secret written to those logs. This issue does not affect customers who are generating the secret value outside of the CDK as the secret is not referenced or logged. ### Impact To leverage this issue, an actor has to be authenticated in the account where logs of the custom resource Custom::DescribeCognitoUserPoolClient are accessible and have read-only permission for lambda function logs. Users can review access to their log group through AWS CloudTrail logs to detect any unexpected access to read the logs. **Impacted versions: >2.37.0 and <=2.187.0** ### Patches The patches are included in the AWS CDK Library release v2.187.0. We recommend upgrading to the latest version and ensuring any forked or derivative code is patched to incorporate the new fixes. To fully address this issue, users should rotate the secret by generating a new secret stored in AWS Secrets Manager. References to the secret will use the new secret on update. When new CDK applications using the latest version are initialized, they will use the new behavior with updated logging. Existing applications must upgrade to the latest version, change the [feature flag](https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md) (@aws-cdk/cognito:logUserPoolClientSecretValue) to false, redeploy the application to apply this fix and use the new implementation with updated logging behavior. ### Workarounds Users can override the implementation changing Logging to be Logging.withDataHidden(). For example define class CustomUserPoolClient extends UserPoolClient and in the new class define get userPoolClientSecret() to use Logging.withDataHidden(). Example export class CustomUserPoolClient extends UserPoolClient { private readonly customUserPool : UserPool; private readonly customuserPoolClientId : string; constructor(scope: Construct, id: string, props: UserPoolClientProps) { super(scope, id, props); this.customUserPool = new UserPool(this, 'pool', { removalPolicy: RemovalPolicy.DESTROY, }); const client = this.customUserPool.addClient('client', { generateSecret: true }); } // Override the userPoolClientSecret getter to always return the secret public get userPoolClientSecret(): SecretValue { // Create the Custom Resource that assists in resolving the User Pool Client secret const secretValue = SecretValue.resourceAttribute(new AwsCustomResource( this, 'DescribeCognitoUserPoolClient', { resourceType: 'Custom::DescribeCognitoUserPoolClient', onUpdate: { region: cdk.Stack.of(this).region, service: 'CognitoIdentityServiceProvider', action: 'describeUserPoolClient', parameters: { UserPoolId: this.customUserPool.userPoolId, ClientId: this.customUserPool, }, physicalResourceId: PhysicalResourceId.of(this.userPoolClientId), // Disable logging of sensitive data logging: Logging.withDataHidden(), }, policy: AwsCustomResourcePolicy.fromSdkCalls({ resources: [this.customUserPool.userPoolArn], }), installLatestAwsSdk: false, }, ).getResponseField('UserPoolClient.ClientSecret')); return secretValue; } } ### References If you have any questions or comments about this advisory please 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.
- Published
- Mar 31, 2025
- Updated
- Mar 31, 2025
- EPSS
- —
- CWE
- —
Report tools
Action score
26
Low priority for now.
- CVSS
- 26 / 40 · 6.5 / 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.37.0 · before 2.187.0 | 2.187.0 |
Same product
npm: all recordsOther highest-scoring records for the same primary product.
- GHSA-5pq3-h73f-66hrAWS CDK CodePipeline: trusted entities are too broad15Monitor
- GHSA-464c-974j-9xm6AWS CDK CodeBuild S3 Log Encryption Boolean Inversion13Monitor
- GHSA-qc59-cxj2-c2w4aws-cdk-lib's aspect order change causes different Permissions Boundary assigned to Role8Monitor
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.187.0 | 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.
- A low-privileged account is enough.
- No user action is required.
- No special conditions are required; it is repeatable.
If successful
- Confidentiality
- high · data can be read
- Integrity
- none
- Availability
- none
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- Low
- User interaction
- None
- Scope
- Unchanged
- Confidentiality impact
- High
- Integrity impact
- None
- Availability impact
- None
Weakness class (CWE)
—
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
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.
MITRE has no CAPEC/ATT&CK mapping for this CWE.
Change log (1)
- Fix✗ → ✓
For records you follow, these changes also arrive as notifications. →
References
Show all references (2 more)Show less
Vendor advisories and official records. Exploit/PoC links are deliberately left out.