Mittel

AWS CDK CLI prints AWS credentials retrieved by custom credential plugins

  • Veröffentlicht: 21.03.2025
  • Aktualisiert: 11.10.2026 10:22

Summary

The AWS Cloud Development Kit (AWS CDK) [1] is an open-source software development framework for defining cloud infrastructure in code and provisioning it through AWS CloudFormation. The AWS CDK CLI [2] is a command line tool for interacting with CDK applications. Customers can use the CDK CLI to create, manage, and deploy their AWS CDK projects.

An issue exists in the AWS CDK CLI where, under certain conditions, AWS credentials may be returned in the console output. Plugins that return an expiration property in the credentials object are affected by this issue. Plugins that omit the expiration property are not affected.

Impact

When customers run AWS CDK CLI commands with credential plugins and configure those plugins to return temporary credentials by including an expiration property, the AWS credentials retrieved by the plugin may be returned in the console output. Any user with access where the CDK CLI was ran would have access to this output.

The following are examples of configuring a custom credential plugin:

Via command line option:

cdk deploy --plugin /path/to/plugin

Via configuration file [3]:

js
{
  "plugin": "/path/to/plugin"
}

Plugins that return an expiration property in the credentials object, such as the following example, are affected:

bash
return {
    accessKeyId: '<access-key>',
    secretAccessKey: '<secret-access-key>',
    sessionToken: '<session-token>',
    expiration: <date>,
};

The expiration property indicates that the provided credentials are temporary.

Please refer to our "AWS CDK CLI Library" guide for more information about custom credential plugins [4].

Impacted versions: >=2.172.0 and <2.178.2

Patches

The issue has been addressed in version 2.178.2 [5]. We recommend upgrading to the latest version and ensuring any forked or derivative code is patched to incorporate the new fixes.

Workarounds

If you are unable to upgrade to version 2.178.2 or later, you can downgrade to version 2.171.1. If you are unable to downgrade, but have access to the code of the credential plugin you use, you can remove the expiration property from the object returned by the plugin.

For example, change the code from returning this:

js
return {
    accessKeyId: assumeRoleOutput.Credentials.AccessKeyId,
    secretAccessKey: assumeRoleOutput.Credentials.SecretAccessKey,
    sessionToken: assumeRoleOutput.Credentials.SessionToken,

    // Expiration indicates to the CLI that this is temporary
    expiration: assumeRoleOutput.Credentials.Expiration,
};

To return this:

js
return {
    accessKeyId: assumeRoleOutput.Credentials.AccessKeyId,
    secretAccessKey: assumeRoleOutput.Credentials.SecretAccessKey,
    sessionToken: assumeRoleOutput.Credentials.SessionToken,
};

Note that this will prevent the CDK CLI from refreshing the credentials when needed, and may cause your workflow to fail on an expired credentials error.

References

[1] https://docs.aws.amazon.com/cdk/v2/guide/home.html

[2] https://docs.aws.amazon.com/cdk/v2/guide/cli.html

[3] https://docs.aws.amazon.com/cdk/v2/guide/cli.html#cli-config

[4] https://www.npmjs.com/package/@aws-cdk/cli-plugin-contract

[5] https://github.com/aws/aws-cdk/releases/tag/v2.178.2

Betroffene Software

Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.

PlattformPaketAnfällige VersionenBehoben in
npm-Paket aws-cdk >= 2.172.0, < 2.178.2 2.178.2
npm-Paket cdk >= 2.172.0, < 2.178.2 2.178.2

Verweise

CVSS-Wert 5.5/10
CVSS-Vektor
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N
Schwäche (CWE)
CWE-497
Plattform
npm
Paket
aws-cdk, cdk
Veröffentlicht
21.03.2025
Aktualisiert
11.10.2026 10:22

Quellen und Lizenzen

OSV / GitHub Advisory Database - GHSA-v63m-x9r9-8gqp - CC BY 4.0

Schwachstellenhistorie: aws-cdk

Alle veröffentlichten Schwachstellen dieses Pakets (npm-Paket), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.

Einträge insgesamt
2
Erste → letzte
08.2024 03.2025
Ohne Fix
0
In Angriffen ausgenutzt
0

Verteilung nach Schweregrad

  • Mittel 2

Veröffentlichungen pro Jahr

  1. 2024: 1
  2. 2025: 1
  3. 2026: 0
  1. AWS CDK CLI prints AWS credentials retrieved by custom credential plugins dieser Eintrag
    Mittel · 5.5 CVE-2025-2598 >= 2.172.0, < 2.178.2 2.178.2
  2. Mittel · 6.4 CVE-2024-45037 >= 2.142.0, < 2.148.1 2.148.1

Erkennen Sie Schwachstellen in Ihrer Anwendung

Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.

Anwendung verbinden
DockRay Newsletter

Anwendungssicherheit in Ihrem Postfach

Wichtige Schwachstellen, konkrete Empfehlungen und praktische Tipps für Ihre Anwendungen. Wählen Sie Ihre Technologien und verfolgen Sie, was für Ihr Projekt relevant ist.

  • Eine tägliche Zusammenfassung neuer Schwachstellen, auch kritischer.
  • Benachrichtigungen über wichtige Updates.
  • Praktische Tipps zur Sicherheit und Überwachung von Anwendungen.

Leer lassen, um Meldungen zu allen Technologien zu erhalten.

Kostenlos anmelden. In jeder E-Mail mit einem Klick abmelden.