Skip to main content
Vulnerability Database/CVE-2026-104002

CVE-2026-104002: AWS Lambda Powertools Data Masking Flaw

CVE-2026-104002 is an information disclosure vulnerability in Powertools for AWS Lambda Python that exposes sensitive data through fail-open error handling. This article covers technical details, impact analysis, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-104002 Overview

CVE-2026-104002 is a fail-open error handling flaw in the data masking utility of Powertools for AWS Lambda (Python). When the masking routine encounters an error while processing a field, it returns the original unmasked value instead of failing closed. Applications that rely on the utility to obscure sensitive fields in logs, responses, or downstream payloads may inadvertently expose plaintext data such as personally identifiable information (PII), credentials, or financial records. The weakness is categorized under CWE-390: Detection of Error Condition Without Action. Maintainers resolved the issue in version 3.35.0 of the library.

Critical Impact

Sensitive field values intended to be masked may be returned in plaintext when the masking function errors, leading to confidentiality loss across logs and downstream consumers.

Affected Products

  • Powertools for AWS Lambda (Python) versions prior to 3.35.0
  • AWS Lambda functions using the aws_lambda_powertools.utilities.data_masking module
  • Downstream services and log sinks that trust the masking utility output

Discovery Timeline

  • 2026-10-01 - CVE-2026-104002 published to NVD
  • 2026-10-02 - Last updated in NVD database

Technical Details for CVE-2026-104002

Vulnerability Analysis

The data masking utility in Powertools for AWS Lambda (Python) is designed to replace sensitive JSON field values with a masked token before the data is logged, returned, or forwarded. The vulnerable code path handles exceptions raised during masking by continuing execution without substituting the field value. As a result, the function completes successfully and emits the original cleartext content.

This is a classic fail-open condition. Developers calling the utility assume a safe default: if masking fails, no sensitive data should be released. The implementation instead prioritizes availability over confidentiality. Any serialization error, schema mismatch, encryption provider failure, or unexpected field type can trigger the fallback and leak the field.

The practical impact depends on where the output is consumed. Lambda function logs flow to Amazon CloudWatch, where any principal with log read permissions can retrieve the plaintext. API responses may send unmasked values to clients, and event-driven integrations may propagate the data to SQS, SNS, EventBridge, or S3.

Root Cause

The root cause is improper detection of an error condition without a protective action, consistent with CWE-390. The masking function catches or ignores internal exceptions and returns the untransformed input rather than raising, redacting the entire field, or substituting a safe placeholder.

Attack Vector

An actor who can influence the structure or content of the data processed by a Lambda function may craft input that forces the masking routine into its error path. The attacker does not need to execute code on the Lambda; they only need to supply payloads that cause masking to fail. Any party with read access to the resulting logs, responses, or downstream events then observes the unmasked sensitive field. Exploitation requires low privileges and no user interaction, and the attack is reachable over the network through the Lambda's event sources.

No verified public proof-of-concept is available. See the GitHub Security Advisory GHSA-3vxg-4xv2-jfh5 for maintainer-supplied technical detail.

Detection Methods for CVE-2026-104002

Indicators of Compromise

  • CloudWatch log entries from Lambda functions containing fields that should have been masked, such as full account numbers, API keys, or email addresses.
  • Downstream records in SQS, SNS, EventBridge, or S3 containing plaintext values originating from functions that import aws_lambda_powertools.utilities.data_masking.
  • Exceptions or warnings from the data masking module immediately preceding log entries that include sensitive data.

Detection Strategies

  • Inventory Lambda deployment packages and layers for Powertools for AWS Lambda (Python) versions earlier than 3.35.0.
  • Scan source repositories and requirements.txt or pyproject.toml files for aws-lambda-powertools pinned below 3.35.0.
  • Run pattern-based scans across CloudWatch Logs for regular expressions matching PII, PAN, or secret formats in log groups owned by affected functions.

Monitoring Recommendations

  • Enable CloudWatch Logs data protection policies to identify sensitive data patterns in Lambda log streams.
  • Alert on error-level log events emitted by the data_masking module, since these correlate with the fail-open path.
  • Track outbound Lambda payloads to downstream services and compare against expected masked field schemas.

How to Mitigate CVE-2026-104002

Immediate Actions Required

  • Upgrade Powertools for AWS Lambda (Python) to version 3.35.0 or later across all Lambda functions, layers, and container images.
  • Review CloudWatch Logs retention windows for affected functions and purge or restrict access to logs that may contain unmasked sensitive values.
  • Rotate any secrets, tokens, or credentials that may have been exposed through the fail-open behavior.

Patch Information

The fix is published in Powertools for AWS Lambda (Python) 3.35.0. Refer to the GitHub Release v3.35.0, the GitHub Security Advisory GHSA-3vxg-4xv2-jfh5, and the AWS Security Bulletin 2026-123 for authoritative remediation guidance.

Workarounds

  • Wrap calls to the masking utility in application code that validates the output and raises an exception if the returned value matches the input for fields known to be sensitive.
  • Apply CloudWatch Logs data protection policies to redact sensitive patterns at the log layer until the library upgrade is complete.
  • Restrict IAM permissions on CloudWatch log groups and downstream destinations so that only required principals can read Lambda output.
bash
# Upgrade the library in your Lambda build pipeline
pip install --upgrade "aws-lambda-powertools>=3.35.0"

# Verify the installed version
python -c "import aws_lambda_powertools; print(aws_lambda_powertools.__version__)"

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.