Skip to content

AWS CDK CodeBuild S3 Log Encryption Boolean Inversion

Low severity GitHub Reviewed Published Jul 22, 2026 in aws/aws-cdk • Updated Jul 24, 2026

Package

npm @aws-cdk/aws-codebuild (npm)

Affected versions

>= 1.75.0, <= 1.204.0

Patched versions

None
nuget Amazon.CDK.AWS.CodeBuild (NuGet)
>= 1.75.0, <= 1.204.0
None
nuget Amazon.CDK.Lib (NuGet)
< 2.253.0
2.253.0
npm aws-cdk-lib (npm)
< 2.253.0
2.253.0
pip aws-cdk-lib (pip)
< 2.253.0
2.253.0
pip aws-cdk.aws-codebuild (pip)
>= 1.75.0, <= 1.204.0
None
gomod github.com/aws/aws-cdk-go/awscdk (Go)
>= 1.175.0-devpreview, <= 1.204.0-devpreview
None
gomod github.com/aws/aws-cdk-go/awscdk/v2 (Go)
< 2.253.0
2.253.0
maven software.amazon.awscdk:aws-cdk-lib (Maven)
< 2.253.0
2.253.0
maven software.amazon.awscdk:codebuild (Maven)
>= 1.75.0, <= 1.204.0
None

Description

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. We identified an issue in which explicitly setting encrypted: true on the S3LoggingOptions property of an AWS CodeBuild project construct produces the opposite of the intended behavior, disabling encryption on CodeBuild build logs stored in S3.

Impact

The S3LoggingOptions.encrypted property in the aws-codebuild module uses positive polarity (true = encryption ON), but is mapped directly to the CloudFormation S3LogsConfig.EncryptionDisabled field, which uses negative polarity (true = encryption OFF). Because the value is not negated before being passed to CloudFormation, any explicit assignment produces inverted behavior:

  • Setting encrypted: true (intending encryption ON) causes CloudFormation to receive EncryptionDisabled: true, disabling encryption.

  • Setting encrypted: false (intending encryption OFF) causes CloudFormation to receive EncryptionDisabled: false, enabling encryption.

Users who omit the property entirely are not affected, as undefined passes through to CloudFormation, which defaults to encryption enabled.

Users affected by this issue could have CodeBuild S3 build logs stored using SSE-S3 (Amazon S3-managed keys, AES-256) rather than the AWS managed keys that CodeBuild applies by default. Since January 5, 2023, Amazon S3 automatically encrypts all new object uploads with SSE-S3, so logs written after that date remain encrypted at rest. However, logs written prior to that date to buckets that did not have default encryption configured at the time are potentially not encrypted at rest.

Impacted versions: >= 1.75.0 and <= 2.252.0

Patches

This issue has been addressed in aws-cdk-lib version 2.253.0. Upgrade to the latest version and ensure any forked or derivative code is patched to incorporate the new fixes.

Workarounds

Users who are unable to immediately upgrade to version 2.253.0 should omit the encrypted property from their S3LoggingOptions configuration entirely. When the property is omitted, the value is not passed to CloudFormation, and CodeBuild applies its default behavior of encrypting build logs using AWS managed keys.

References

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

[1] https://aws.amazon.com/security/vulnerability-reporting/

Acknowledgement

AWS thanks AISafe for collaborating on this issue through the coordinated disclosure process.

References

@aemada-aws aemada-aws published to aws/aws-cdk Jul 22, 2026
Published to the GitHub Advisory Database Jul 24, 2026
Reviewed Jul 24, 2026
Last updated Jul 24, 2026

Severity

Low

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Local
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Unchanged
Confidentiality
Low
Integrity
None
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N

EPSS score

Weaknesses

Missing Encryption of Sensitive Data

The product does not encrypt sensitive or critical information before storage or transmission. Learn more on MITRE.

Incorrect Calculation

The product performs a calculation that generates incorrect or unintended results that are later used in security-critical decisions or resource management. Learn more on MITRE.

CVE ID

No known CVE

GHSA ID

GHSA-464c-974j-9xm6

Source code

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.