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-95105 Overview
CVE-2026-95105 affects the cloak Elixir library maintained by danielberkompas. The library encrypts data using AES-256 in Counter (CTR) mode but stores the ciphertext without a Message Authentication Code (MAC). An attacker with write access to the ciphertext store can flip bits in the ciphertext to produce a chosen plaintext of the same length. The flaw spans Cloak.Ciphers.AES.CTR and the legacy Cloak.Ciphers.Deprecated.AES.CTR modules. The weakness is tracked under [CWE-649: Reliance on Obfuscation or Encryption of Security-Relevant Inputs without Integrity Checking].
Critical Impact
An attacker who can write to the encrypted store and who knows or can guess a stored plaintext can silently replace it with any attacker-chosen value of equal length.
Affected Products
- cloak Elixir library, versions 0.1.0-pre and later
- Cloak.Ciphers.AES.CTR module
- Cloak.Ciphers.Deprecated.AES.CTR legacy module
Discovery Timeline
- 2026-10-06 - CVE-2026-95105 published to NVD
- 2026-10-06 - Last updated in NVD database
Technical Details for CVE-2026-95105
Vulnerability Analysis
The Cloak.Ciphers.AES.CTR module encrypts data using AES-256 in CTR mode and stores three fields: the key tag, the initialization vector (IV), and the ciphertext. No authentication tag or MAC is appended. The decrypt/2 function validates only the key tag and a minimum length constraint before returning plaintext. The legacy Cloak.Ciphers.Deprecated.AES.CTR module follows the same unauthenticated path.
CTR mode operates as a stream cipher. The plaintext is produced by XOR-ing the ciphertext with a key stream derived from the key and IV. This property means any bit modification applied to the stored ciphertext propagates to the same offset in the recovered plaintext. Without integrity verification, the decryption routine cannot distinguish between legitimate and tampered ciphertext.
Root Cause
The root cause is a design choice to omit authenticated encryption. CTR mode provides confidentiality but not integrity. Secure deployments require pairing CTR with a MAC such as HMAC-SHA256, or using an authenticated mode such as AES-GCM. The affected modules provide neither, allowing silent plaintext substitution.
Attack Vector
Exploitation requires write access to the encrypted store. SQL injection, a compromised database replica, or a malicious insider with database privileges all satisfy this prerequisite. The attacker must also know or guess the current plaintext at the targeted offset. Given a known plaintext P, the attacker computes C' = C XOR P XOR P' where P' is the chosen plaintext. The modified ciphertext decrypts to P' without raising an error.
// Bit-flipping relationship in AES-CTR without MAC
keystream = AES-CTR(key, IV)
C = P XOR keystream // original ciphertext
C' = C XOR (P XOR P') // attacker-crafted ciphertext
P' = C' XOR keystream // decryption returns attacker-chosen plaintext
Source: CNA Security Advisory CVE-2026-95105
Detection Methods for CVE-2026-95105
Indicators of Compromise
- Unexpected plaintext values returned from fields encrypted via Cloak.Ciphers.AES.CTR where application logic indicates tampering.
- Database audit log entries showing writes to encrypted columns from sources other than the application itself.
- Replica or backup divergence in ciphertext bytes for records that were not legitimately updated.
Detection Strategies
- Inventory applications depending on cloak and identify callers of Cloak.Ciphers.AES.CTR and Cloak.Ciphers.Deprecated.AES.CTR.
- Monitor database query patterns for anomalous UPDATE statements targeting encrypted columns, which can indicate SQL injection paving the way to ciphertext tampering.
- Correlate replica write events with application-origin writes to identify out-of-band ciphertext modifications.
Monitoring Recommendations
- Enable row-level audit logging on tables storing Cloak-encrypted fields and alert on writes outside application service accounts.
- Track upstream advisories from the CNA Security Advisory CVE-2026-95105 and the OSV Vulnerability Report EEF-CVE-2026-95105 for patched versions and migration guidance.
- Deploy database activity monitoring to flag replica-origin writes that bypass primary application controls.
How to Mitigate CVE-2026-95105
Immediate Actions Required
- Upgrade cloak to a patched version once published by the maintainer and re-encrypt affected records using an authenticated cipher.
- Migrate fields currently protected by Cloak.Ciphers.AES.CTR to an authenticated encryption scheme such as AES-GCM.
- Restrict write access to encrypted stores and remediate any SQL injection paths that could expose ciphertext to tampering.
Patch Information
Refer to the GitHub Commit for Cloak Project and the CNA Security Advisory CVE-2026-95105 for the authoritative fix. The maintainer's advisory documents the vulnerable modules and the recommended cipher replacements.
Workarounds
- Wrap stored ciphertext with an HMAC-SHA256 tag computed over the IV and ciphertext, and verify the tag before calling decrypt/2.
- Replace Cloak.Ciphers.AES.CTR and Cloak.Ciphers.Deprecated.AES.CTR with an authenticated cipher module in Cloak's configuration.
- Enforce least-privilege database roles so that only the application service account can write to columns storing encrypted values.
# Example Cloak configuration migrating from AES-CTR to AES-GCM
config :my_app, MyApp.Vault,
ciphers: [
default: {Cloak.Ciphers.AES.GCM, tag: "AES.GCM.V1", key: Base.decode64!(System.get_env("CLOAK_KEY"))}
]
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

