VYPR
Moderate severityNVD Advisory· Published Mar 21, 2025· Updated Oct 14, 2025

AWS CDK CLI prints AWS credentials retrieved by custom credential plugins

CVE-2025-2598

Description

When the AWS Cloud Development Kit (AWS CDK) Command Line Interface (AWS CDK CLI) is used with a credential plugin which returns an expiration property with the retrieved AWS credentials, the credentials are printed to the console output. To mitigate this issue, users should upgrade to version 2.178.2 or later and ensure any forked or derivative code is patched to incorporate the new fixes.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

AWS CDK CLI versions 2.172.0 to 2.178.1 may print AWS credentials to console output when using credential plugins that return an expiration property; upgrade to 2.178.2 to fix.

Vulnerability

Overview

CVE-2025-2598 affects the AWS Cloud Development Kit (AWS CDK) Command Line Interface (CLI) when used with custom credential plugins that return an expiration property in the credentials object. In affected versions (>=2.172.0 and <2.178.2), the CLI inadvertently prints the retrieved AWS credentials—including accessKeyId, secretAccessKey, and sessionToken—to the console output [2][3]. Plugins that omit the expiration property are not affected [3][4].

Exploitation

Conditions

An attacker does not need direct network access to the CDK CLI process; instead, they require access to the console or log output where the CDK CLI was executed. This could occur in shared development environments, CI/CD pipelines, or any system where console output is captured and stored. The vulnerability is triggered automatically when a credential plugin returns temporary credentials with an expiration field, as the CLI logs the entire credentials object [3][4].

Impact

If exploited, an attacker with access to the console output can obtain valid AWS temporary credentials. These credentials could be used to perform actions within the AWS account associated with the CDK deployment, potentially leading to unauthorized resource access, data exfiltration, or privilege escalation. The severity is heightened because the credentials are printed in plaintext and may remain in logs indefinitely [3][4].

Mitigation

AWS has released a fix in CDK CLI version 2.178.2 [3][4]. Users should upgrade immediately. For those unable to upgrade, a workaround is to downgrade to version 2.171.1 or modify the credential plugin to omit the expiration property if temporary credentials are not required. Additionally, users should audit console logs for any leaked credentials and rotate them if found [4].

AI Insight generated on May 20, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
aws-cdknpm
>= 2.172.0, < 2.178.22.178.2
cdknpm
>= 2.172.0, < 2.178.22.178.2

Affected products

2
  • Aws/AWS CDK CLIllm-create
    Range: <2.178.2
  • AWS/Cloud Development Kit Command Line Interfacev5
    Range: 2.172.0

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

6

News mentions

0

No linked articles in our index yet.