CVE-2026-47842 Overview
CVE-2026-47842 affects Spring Security's AesBytesEncryptor class. Applications that instantiate the encryptor using the two-argument constructor, or that pass a null initialization vector (IV) generator while selecting Cipher Block Chaining (CBC) mode, encrypt data with an all-zero IV. A static IV in CBC mode breaks the semantic security guarantees of the algorithm and enables cryptographic attacks against ciphertext confidentiality.
Critical Impact
Data encrypted with the affected AesBytesEncryptor configurations is protected by AES/CBC with a null IV, allowing equal plaintexts to produce equal ciphertexts and exposing patterns in stored or transmitted secrets.
Affected Products
- Spring Security 7.1.0
- Spring Security 7.0.0 through 7.0.6, and 6.5.0 through 6.5.11
- Spring Security 6.4.0 through 6.4.18, 5.8.0 through 5.8.27, and 5.7.0 through 5.7.25
Discovery Timeline
- 2026-08-26 - CVE-2026-47842 published to the National Vulnerability Database
- 2026-08-26 - Last updated in NVD database
Technical Details for CVE-2026-47842
Vulnerability Analysis
The flaw is a weak cryptography defect in Spring Security's symmetric encryption helper. AesBytesEncryptor supports multiple cipher modes, including CBC and Galois/Counter Mode (GCM). When callers construct the encryptor without supplying a BytesKeyGenerator for the IV, the class does not generate a fresh random IV per encryption operation. Instead, it produces ciphertext under AES/CBC using an all-zero IV.
CBC mode requires a unique, unpredictable IV for each encryption to prevent deterministic output. With a static IV, identical plaintexts under the same key yield identical ciphertexts. This enables an attacker with access to ciphertext to correlate encrypted values, detect repeated secrets, and mount chosen-plaintext distinguishing attacks. The vulnerability is classified as Weak Encryption and maps to [CWE-329] Generation of Predictable IV with CBC Mode.
Root Cause
The defect resides in the two-argument constructor path of AesBytesEncryptor and in the code path where a null IV generator is passed alongside CipherAlgorithm.CBC. In these cases, the encryptor omits IV randomization and defaults to an all-zero IV block. Developers who follow documented constructor signatures without explicitly wiring a secure IV source inherit the flaw silently.
Attack Vector
An attacker with authenticated network access, or with read access to ciphertext produced by the affected code, can analyze repeated ciphertext blocks to infer plaintext patterns. The attack does not require user interaction. Exploitation targets confidentiality of encrypted tokens, credentials, or persisted secrets. Integrity and availability are not directly affected. Refer to the Spring Security CVE-2026-47842 advisory for vendor-supplied technical detail.
Detection Methods for CVE-2026-47842
Indicators of Compromise
- Ciphertext records in application databases where identical plaintext values produce byte-identical ciphertext output.
- Application dependency manifests referencing spring-security-crypto at any affected version range.
- Source code invocations of new AesBytesEncryptor(password, salt) or constructors passing null as the IV generator with CipherAlgorithm.CBC.
Detection Strategies
- Perform software composition analysis (SCA) across Java build artifacts to enumerate Spring Security versions and flag matches against the vulnerable ranges.
- Grep source repositories for AesBytesEncryptor instantiations and audit each call site for explicit IV generator configuration.
- Review cryptographic inventories to identify systems using CBC mode without documented per-record IVs.
Monitoring Recommendations
- Track cryptographic library upgrades through change management and confirm redeployment of applications after patching.
- Monitor data stores for duplicate ciphertext values indicating deterministic encryption in production.
- Alert on runtime loading of vulnerable spring-security-crypto versions using endpoint telemetry from your EDR platform.
How to Mitigate CVE-2026-47842
Immediate Actions Required
- Upgrade spring-security-crypto to a fixed release published by the Spring Security team as identified in the vendor advisory.
- Replace the two-argument AesBytesEncryptor constructor with a variant that accepts a secure BytesKeyGenerator for IV generation, or use GCM mode.
- Re-encrypt any previously stored data that was protected with the affected configuration under a new key and a properly randomized IV.
Patch Information
Spring Security has published fixes referenced in the Spring Security CVE-2026-47842 advisory. Consult the advisory for the specific patched versions in the 7.0.x, 6.5.x, 6.4.x, 5.8.x, and 5.7.x branches, and apply the closest maintained release for your deployment.
Workarounds
- Configure AesBytesEncryptor with an explicit IV generator, for example KeyGenerators.secureRandom(16), instead of relying on default constructors.
- Migrate encryption to AES/GCM by using AesBytesEncryptor.CipherAlgorithm.GCM, which enforces IV handling suitable for authenticated encryption.
- Restrict access to ciphertext at rest and in transit to reduce exposure while patching is in progress.
# Example Maven dependency pin after upgrade
mvn dependency:tree | grep spring-security-crypto
# Update pom.xml to the patched version from the Spring advisory, then rebuild
mvn -U clean verify
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

