CVE-2025-14761 Overview
CVE-2025-14761 is a cryptographic key commitment weakness in the AWS SDK for PHP S3 encryption client. The flaw affects scenarios where the encrypted data key (EDK) is stored in an S3 "instruction file" rather than in the S3 object metadata record. A user with write access to the S3 bucket can substitute a new EDK that decrypts the same ciphertext to a different plaintext. The issue is tracked under CWE-327: Use of a Broken or Risky Cryptographic Algorithm. AWS addressed the flaw in AWS SDK for PHP version 3.368.0.
Critical Impact
An authorized S3 writer can replace the instruction file's EDK so decryption produces attacker-controlled plaintext without detection, undermining the integrity of encrypted objects.
Affected Products
- AWS SDK for PHP versions prior to 3.368.0
- S3 encryption client configurations using instruction files for EDK storage
- Applications relying on the SDK's client-side encryption for S3 object integrity
Discovery Timeline
- 2025-12-17 - CVE-2025-14761 published to NVD
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2025-14761
Vulnerability Analysis
The AWS SDK for PHP client-side encryption workflow wraps a per-object data encryption key with a key encryption key (KEK) and stores the resulting EDK alongside the ciphertext. Two storage modes exist: metadata headers on the S3 object, or a separate instruction file object.
When the instruction file mode is used, the SDK does not bind the EDK to the ciphertext through a key commitment mechanism. A principal with s3:PutObject on the instruction file object can overwrite it with a new EDK derived from a different data key. The SDK accepts the substituted EDK during decryption and yields plaintext that differs from the plaintext originally encrypted.
The vulnerability enables plaintext substitution attacks against downstream consumers that trust the SDK's decryption output. It does not disclose the original plaintext, but it breaks integrity guarantees that consumers may rely on for authorization, configuration, or business logic decisions.
Root Cause
The SDK's encryption scheme lacks key commitment. Authenticated encryption modes such as AES-GCM guarantee that a given ciphertext decrypts correctly under only one key, but they do not prevent an attacker who controls the key material from crafting alternate (key, ciphertext) pairs that decrypt without error to attacker-chosen plaintext. Storing the EDK in a separately writable instruction file exposes this gap.
Attack Vector
An attacker needs write permission to the target S3 bucket path where instruction files reside. The attacker generates a new data key, encrypts chosen plaintext, wraps the new data key under an accessible KEK, and replaces the instruction file. When a legitimate consumer next decrypts the object, the SDK returns the substituted plaintext. Refer to the GitHub Security Advisory GHSA-x8cp-jf6f-r4xh and the AWS Security Bulletin 2025-032 for additional technical detail.
Detection Methods for CVE-2025-14761
Indicators of Compromise
- Unexpected PutObject events targeting .instruction sibling objects in CloudTrail S3 data event logs.
- Instruction file LastModified timestamps that diverge from their corresponding ciphertext object timestamps.
- KMS Decrypt or GenerateDataKey calls originating from identities that should not perform client-side encryption operations.
Detection Strategies
- Enable S3 data event logging in AWS CloudTrail and alert on write operations to any object ending in .instruction.
- Correlate S3 object versions between ciphertext and instruction file pairs to identify mismatched modification lineage.
- Inventory applications that instantiate S3EncryptionClient or S3EncryptionMultipartUploader with instruction file metadata strategy.
Monitoring Recommendations
- Track invocations of AWS SDK for PHP versions below 3.368.0 across build pipelines and dependency manifests.
- Monitor IAM policies that grant s3:PutObject on encryption instruction paths and flag broad principals.
- Review AWS KMS grants and key policies for unexpected consumers of KEKs used by the encryption client.
How to Mitigate CVE-2025-14761
Immediate Actions Required
- Upgrade AWS SDK for PHP to version 3.368.0 or later using Composer.
- Audit all S3 buckets that store instruction files and restrict write access to authorized encryption principals.
- Rotate KMS keys used with the encryption client if unauthorized write access to instruction files cannot be ruled out.
Patch Information
AWS released the fix in AWS SDK for PHP 3.368.0. See the GitHub SDK PHP Release 3.368.0 notes and the AWS Security Bulletin 2025-032 for the coordinated advisory.
Workarounds
- Migrate client-side encrypted objects to store the EDK in S3 object metadata rather than instruction files.
- Apply least-privilege IAM policies that deny writes to *.instruction objects for all non-encryption principals.
- Enable S3 Object Lock or versioning on encrypted buckets to preserve legitimate instruction file states for forensic comparison.
# Update AWS SDK for PHP via Composer
composer require aws/aws-sdk-php:^3.368.0
composer update aws/aws-sdk-php
# Verify installed version
php -r "require 'vendor/autoload.php'; echo Aws\\Sdk::VERSION;"
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

