Skip to content

fix: update dependency aws-cdk-lib to v2.246.0 [security]#563

Merged
renovate[bot] merged 1 commit into
mainfrom
renovate/npm-aws-cdk-lib-vulnerability
Jun 17, 2026
Merged

fix: update dependency aws-cdk-lib to v2.246.0 [security]#563
renovate[bot] merged 1 commit into
mainfrom
renovate/npm-aws-cdk-lib-vulnerability

Conversation

@renovate

@renovate renovate Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

ℹ️ Note

This PR body was truncated due to platform limits.

This PR contains the following updates:

Package Change Age Confidence
aws-cdk-lib (source) 2.179.02.246.0 age confidence

aws-cdk-lib has Insertion of Sensitive Information into Log File vulnerability when using Cognito UserPoolClient Construct

GHSA-qq4x-c6h6-rfxh

More information

Details

Summary

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.

The CDK Cognito UserPool construct deploys an AWS cognito user pool. An Amazon Cognito user pool is a user directory for web and mobile app authentication and authorization. Customers can deploy a client under this user pool through construct ‘UserPoolClient’ or through helper method 'addClient'. A user pool client resource represents an Amazon Cognito user pool client 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 (@​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 or directly via email to aws-security@amazon.com. Please do not create a public GitHub issue.

Severity

  • CVSS Score: 6.5 / 10 (Medium)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


aws-cdk-lib's aspect order change causes different Permissions Boundary assigned to Role

GHSA-qc59-cxj2-c2w4

More information

Details

Summary

The AWS Cloud Development Kit (AWS CDK) is an open-source software development framework for defining cloud infrastructure in code and provisioning it through AWS CloudFormation. In the CDK, developers organize their applications into reusable components called "constructs," which are organized into a hierarchical tree structure. One of the features of this framework is the ability to call "Aspects," which are mechanisms to set configuration options for all AWS Resources in a particular part of the hierarchy at once. Aspect execution happens in a specific order, and the last Aspect to execute controls the final values in the template.

AWS CDK version 2.172.0 introduced a new priority system for Aspects. Prior to this version, CDK would run Aspects based on hierarchical location. The new priority system takes precedence over hierarchical location, altering the invocation order of Aspects. Different priority classes were introduced: Aspects added by CDK APIs were classified as MUTATING (priority 200), while Aspects added directly by the user were classified as DEFAULT (priority 500) unless the user specified otherwise. As a result of this change, CDK apps that use a custom Aspect to assign a default permissions boundary and then use a built-in CDK method to override it on select resources could have unexpected permissions boundaries assigned.

The following is an affected code sample:

Aspects.of(stack).add(new CustomAspectThatAssignsDefaultPermissionsBoundaries());   // {1}

PermissionsBoundary.of(lambdaFunc).apply(...);  // {2} -- uses Aspects internally

In versions prior to 2.172.0, the Aspect added by {2} would invoke last and assign its permissions boundary to the Lambda function role.

In versions 2.172.0 and after, the Aspect added by {2} would have priority 200 while the Aspect added by {1} would have priority 500 and therefore be invoked last. The Lambda function role would get the permissions boundary of {1} assigned, which may not be what users expect.

Impact

If an unexpected permissions boundary is selected for a role, it could lead to that role having insufficient permissions. Alternatively, this could lead to a role having wider permissions than intended; however, this could happen only in combination with an overly permissive role policy, as permissions boundaries do not grant permissions by themselves.

Impacted versions: versions 2.172.0 up until 2.189.1

Patches

In version 2.189.1, the behavior has been reverted to the behavior of pre-2.172.0. The new behavior is available through a feature flag:

{
  "context": {
    "@&#8203;aws-cdk/core:aspectPrioritiesMutating": true
  }
}

The patches are included in AWS CDK Library version 2.189.1 and after. We recommend upgrading to the latest version and ensuring any forked or derivative code is patched to incorporate the new fixes.

Workarounds

As a workaround, users can use the location hierarchy to order the invocation of Aspects. To do this, users can assign the custom Aspect a priority of MUTATING to ensure it has the same priority as the Aspect added by the CDK API, and that the location hierarchy is used for the order of invocation Aspects.

The following code is an example:

Aspects.of(stack).add(new CustomAspectThatAssignsDefaultPermissionsBoundaries(), {
  priority: AspectPriority.MUTATING,
});
References

If you have any questions or comments about this advisory, we ask that you contact AWS/Amazon Security via our vulnerability reporting page or directly via email to aws-security@amazon.com. Please do not create a public GitHub issue.

Credit

We would like to thank GoDaddy for collaborating on this issue through the coordinated vulnerability disclosure process.

Severity

  • CVSS Score: 2.2 / 10 (Low)
  • Vector String: CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:N/I:N/A:L

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


AWS CDK CodePipeline: trusted entities are too broad

GHSA-5pq3-h73f-66hr

More information

Details

Summary

The AWS Cloud Development Kit (CDK) is an open-source framework for defining cloud infrastructure using code. Users use it to create their own applications, which are converted to AWS CloudFormation templates during deployment to a user's AWS account. AWS CDK contains pre-built components called "constructs," which 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 AWS CodePipeline construct deploys CodePipeline, a managed service that orchestrates software release processes through a series of stages, each comprising one or more actions executed by CodePipeline. To perform these actions, CodePipeline assumes IAM roles with permissions necessary for each step, allowing it to interact with AWS services and resources on behalf of the user.

An issue exists where, when using CDK to create a CodePipeline with the CDK Construct Library, CDK creates an AWS Identity and Access Management (AWS IAM) trust policy with overly broad permissions. Any user with unrestricted sts:AssumeRole permissions could assume that trust policy. This issue does not affect users who supply their own role for CodePipeline.

Impact

To leverage the issue, an actor has to be authenticated in the account and have an unrestricted sts:AssumeRole permission. The permissions an actor could leverage depend on the actions added to the pipeline. Possible permissions include actions on services such as CloudFormation, CodeCommit, Lambda, and ECS, as well as access to the S3 bucket holding pipeline build artifacts (see documentation).

Users can review their AWS CloudTrail logs for when the role was assumed to determine if this was expected.

Impacted versions: <v2.189.0
Patches

The patches are included in the CDK Construct Library release v2.189.0. We recommend upgrading to the latest version and ensuring any forked or derivative code is patched to incorporate the new fixes.

When new CDK applications using the latest version are initialized, they will use the new behavior with more restrictive permissions.

Existing applications must upgrade to the latest version, change the feature flag (@​aws-cdk/pipelines:reduceStageRoleTrustScope) and (@​aws-cdk/pipelines:reduceCrossAccountActionRoleTrustScope) to true and redeploy the application to apply this fix and use the new behavior with more restrictive permissions.

Workarounds

You can explicitly supply the role for your CodePipeline and follow the policy recommendations detailed in CodePipeline documentation.

References

Original reporting issue.

If you have any questions or comments about this advisory please contact AWS/Amazon Security via our vulnerability reporting page or directly via email to aws-security@amazon.com. Please do not create a public GitHub issue.

Severity

  • CVSS Score: 3.8 / 10 (Low)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:L/A:N

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


aws-cdk-lib: OS Command Injection in NodejsFunction Bundling

CVE-2026-11417 / GHSA-999r-qq7v-r334

More information

Details

Summary

AWS CDK (aws-cdk-lib) is an open-source framework for defining cloud infrastructure in code and provisioning it through AWS CloudFormation. OS command injection in the NodejsFunction local bundling pipeline in aws-cdk-lib before 2.245.0 (2.246.0 on Windows) might allow a threat actor who controls the value of one or more bundling properties (externalModules, define, loader, inject, or esbuildArgs) to execute arbitrary commands on the host running the CDK toolchain via injected shell metacharacters. This issue requires the threat actor to control the value of one or more of the affected bundling properties in the CDK application.

Impact

During local Lambda bundling, NodejsFunction assembled an esbuild command string from the bundling properties externalModules, define, loader, inject, and esbuildArgs and executed it via a shell (bash -c on Linux/macOS, cmd /c on Windows) through spawnSync. The property values were interpolated without escaping or validation, so values containing shell metacharacters could execute arbitrary commands with the privileges of the user running cdk synth, cdk deploy, or cdk diff. Exploitation requires a threat actor to control one or more of the affected property values in the CDK application — for example via an untrusted npm dependency that vends a wrapper construct, or via a pull request that introduces untrusted values.

Impacted versions:

< 2.245.0 (on Windows, < 2.246.0)

Patches

This issue has been addressed in aws-cdk-lib version 2.245.0 (PR #​37292), with a Windows-specific regression fix in 2.246.0 (PR #​37412). The fix replaces shell-based command execution with array-based spawnSync invocation that does not invoke a shell. We recommend upgrading to the latest version and ensuring any forked or derivative code is patched to incorporate the new fixes.

Workarounds

Ensure the values supplied to NodejsFunction bundling properties (externalModules, define, loader, inject, esbuildArgs) originate only from trusted sources, and audit third-party constructs and pull requests that set them. Upgrading to a fixed version is the recommended remediation.

References

If you have any questions or comments about this advisory, we ask that you contact AWS Security via our vulnerability reporting page or directly via email to aws-security@amazon.com. Please do not create a public GitHub issue.

Acknowledgement

AWS would like to thank the external researcher Hesham Ashraf who reported this issue through the AWS Vulnerability Disclosure Program (HackerOne) for collaborating on it through the coordinated vulnerability disclosure process.

Severity

  • CVSS Score: 7.0 / 10 (High)
  • Vector String: CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Release Notes

aws/aws-cdk (aws-cdk-lib)

v2.246.0

Compare Source

Features
Bug Fixes
Reverts

Alpha modules (2.246.0-alpha.0)

v2.245.0

Compare Source

Features
Bug Fixes

Alpha modules (2.245.0-alpha.0)

Features
  • s3tables-alpha: add support for partition spec, sort order, and table properties (#​36811) (2696cd1)
  • s3tables-alpha: add metrics configuration support for TableBucket (#​37275) (e8786f5)
  • s3tables-alpha: implement ITaggableV2 on TableBucket and Table L2 constructs (#​37277) (69c8944), closes #​33054

v2.244.0

Compare Source

Features
Bug Fixes

Alpha modules (2.244.0-alpha.0)
Bug Fixes
  • kinesisanalytics-flink-alpha: mark deprecated flink runtimes as deprecated (#​37155) (0a89447)

v2.243.0

Compare Source

Features
Bug Fixes
  • dynamodb: resource policies don't have the index ARNs when indexes are added after granting permissions (#​37213) (eb37071)

Alpha modules (2.243.0-alpha.0)

v2.242.0

Compare Source

⚠ BREAKING CHANGES
  • ** L1 resources are automatically generated from public CloudFormation Resource Schemas. They are built to closely reflect the real state of CloudFormation. Sometimes these updates can contain changes that are incompatible with previous types, but more accurately reflect reality. In this release we have changed:

    • aws-ssm: AWS::SSM::MaintenanceWindow: Id attribute removed.
Features
Bug Fixes

Alpha modules (2.242.0-alpha.0)

Features
  • mixins-preview: allow passing resource objects into properties in CFN Property mixins (#​37148) (f238629)
  • mixins-preview: generate EventBridge pattern for all events (#​37081) (f30e836)
  • mixins-preview: support custom merge strategies via IMergeStrategy (#​37170) (0dec011)

v2.241.0

Compare Source

⚠ BREAKING CHANGES
  • ** L1 resources are automatically generated from public CloudFormation Resource Schemas. They are built to closely reflect the real state of CloudFormation. Sometimes these updates can contain changes that are incompatible with previous types, but more accurately reflect reality. In this release we have changed:

aws-codedeploy: AWS::CodeDeploy::DeploymentGroup: Id attribute removed.

Features
Bug Fixes

Alpha modules (2.241.0-alpha.0)

Features
  • mixins-preview: add recordFields and outputFormat to Vended Logs Mixin (#​37042) (dd94c31)
  • mixins-preview: cross account delivery destinations (#​36827) (a759eb6)

v2.240.0

Compare Source

Features
Bug Fixes

Alpha modules (2.240.0-alpha.0)

v2.239.0

Compare Source

⚠ BREAKING CHANGES
  • ** L1 resources are automatically generated from public CloudFormation Resource Schemas. They are built to closely reflect the real state of CloudFormation. Sometimes these updates can contain changes that are incompatible with previous types, but more accurately reflect reality. In this release we have changed:

aws-licensemanager: AWS::LicenseManager::License: Beneficiary property is now required
aws-licensemanager: AWS::LicenseManager::License: ProductSKU property is now required
aws-sagemaker: AWS::SageMaker::Cluster: Orchestrator.Eks property is now immutable

Features
Bug Fixes
  • aws-cdk-lib: update cloud-assembly-schema to resolve peer dependency conflict (#​36953) (f194236), closes #​36939
  • aws-cdk-lib: upgrade version of ajv that triggers CVE scanners (#​37022) (45662ba)
  • ec2: add VPC endpoint naming conventions for some isolated regions (#​36794) (5a7fca5)
  • rds: mark deprecated versions and add new engine versions (#​36937) (6e061d0)

Alpha modules (2.239.0-alpha.0)

⚠ BREAKING CHANGES

redshift-alpha: update default node type from DC2_LARGE to RA3_LARGE

Features
  • bedrock-agentcore-alpha: add fromCodeAsset method to create runtime artifact with local code assets (#​36472) (c5a87e6), closes #​36473
  • bedrock-agentcore-alpha: added new target type (api gateway) in agentcore gateway target. (#​36841) (0842754), closes #​36817
  • mixins-preview: add ECS ClusterSettingsMixin (#​36796) (b8ab5be)
  • mixins-preview: add s3 bucket mixin for publicAccessBlock (#​36905) (feed4b2)
  • mixins-preview: send Vended Logs to pre-created DeliveryDestination using toDestination() (#​36896) (48f1fe6)
Bug Fixes

v2.238.0

Compare Source

⚠ BREAKING CHANGES
  • bedrock-agentcore: Interface extensions require new property implementations
  • aws-bedrock-agentcore-alpha:
    • IGateway now requires gatewayRef getter
    • IGatewayTarget now requires gatewayTargetRef getter
    • IMemory now requires memoryRef getter
    • IBedrockAgentRuntime now requires runtimeRef getter
    • IRuntimeEndpoint now requires runtimeEndpointRef getter
    • IBrowserCustom now requires browserCustomRef getter
    • ICodeInterpreterCustom now requires codeInterpreterCustomRef getter
Features
Bug Fixes
Miscellaneous Chores

Alpha modules (2.238.0-alpha.0)

Features
Bug Fixes

v2.237.1

Compare Source

Bug Fixes
  • core: intrinsic cfn function tokens are not detected as such in java (#​36843) (89cd54f)

Alpha modules (2.237.1-alpha.0)

v2.237.0

Compare Source

⚠ BREAKING CHANGES
  • iam: Receivers of IEncryptedResource objects now have fewer guarantees about the shape of the object. If you still require an IResource, change the type to IEncryptedResource & IResource and/or add a type guard check using Resource.isResource(). Implementations of IEncryptedResource no longer need to implement IResource but must continue to implement IEnvironmentAware. Since IResource extends IEnvironmentAware, there is no change for implementors. Calls to GrantableResources.isEncryptedResource() now require an IEnvironmentAware argument instead of IConstruct.
Features
  • eks: add OidcProviderNative using L1 and deprecate OpenIdConnectProvider custom resource (#​36589) (09383cb)
  • eks: add support overwriteServiceAccount prop in service account construct (#​36751) (3aa38f6)
  • kms: make trustAccountIdentities optional in KeyGrants (#​36786) (06676ac)
  • lambda: add observability support for kafka event source mappings ([#​36808](https://redirect.github.com

Note

PR body was truncated to here.


Configuration

📅 Schedule: (in timezone America/Chicago)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot added the dependency Updates to one or more dependencies label Jun 17, 2026
@renovate renovate Bot merged commit 8fb25e1 into main Jun 17, 2026
1 check passed
@renovate renovate Bot deleted the renovate/npm-aws-cdk-lib-vulnerability branch June 17, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependency Updates to one or more dependencies

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants