Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessObtain write access to ciphertext store via SQLi or replica
-
DeliveryIdentify field with known/guessable plaintext
-
ExploitXOR delta into stored AES-CTR ciphertext
-
ExecutionApplication decrypts to attacker-chosen value
-
ImpactSilent integrity compromise of security-relevant data
Vulnerability Assessment
| Weakness |
CWE
|
| Exploitation Conditions | Exploitation requires three concrete conditions: (1) write access to the stored ciphertext - the description names SQL injection into the Ecto-backed database or a compromised database replica as example vectors; (2) the attacker knows or can correctly guess the existing plaintext at a known offset; and (3) the replacement value must be the same length as the original, since the CTR keystream XOR operates byte-for-byte at a fixed offset. Affected code paths are Cloak.Ciphers.AES.CTR and Cloak.Ciphers.Deprecated.AES.CTR, whose decrypt/2 validates only the key tag and minimum length - no MAC or integrity check - so tampering is accepted with no error. Limiting factors for defenders: the attacker must already control writes to the encrypted store and have plaintext knowledge, which bounds realistic risk well below the PR:N headline; impact is integrity-only (no plaintext disclosure). All versions from 0.1.0-pre onward are affected. |
| Impact | The vendor-supplied CVSS 4.0 score of 8.2 (High) is driven entirely by VI:H (integrity), with VC:N and VA:N - this is a pure integrity/tampering flaw, not an information-disclosure or availability issue. Critically, the vector includes AT:P (attack requirement present), reflecting that exploitation is NOT simply remote-unauthenticated despite PR:N: the attacker must already possess write access to the stored ciphertext (via SQL injection or a compromised DB replica) AND know or correctly guess the target plaintext. So although PR:N technically reports 'no application privileges', the real-world precondition is substantial. No EPSS score, no CISA KEV listing, and no public PoC were provided, so there is no signal of active or widespread exploitation. Net assessment: this is a genuine cryptographic design weakness (CWE-649, missing MAC on AES-CTR) that is high-impact where triggered, but gated behind a meaningful precondition - it is a real priority for applications that store security-relevant fields (auth flags, roles, tokens) under Cloak AND where database write/SQLi exposure is plausible, rather than a broadly wormable issue. Conflict to note explicitly: CVSS reports PR:N (unauthenticated) yet the description requires pre-existing write access to the datastore - defenders should treat this as requiring backend write capability, not open internet-facing exploitation. |
| Exploit ScenarioDerived | An attacker who gains write access to the database backing an Ecto application - for example via a SQL injection flaw or access to a compromised read replica - locates a Cloak-encrypted column whose plaintext they know or can guess (e.g. a boolean admin flag or a known string). Because AES-CTR is a stream cipher with no MAC, they XOR the difference between the known plaintext and their desired value into the stored ciphertext at the matching offset, and the application silently decrypts the tampered record to the attacker-chosen value. No public exploit code was identified at time of analysis, but the bit-flipping technique is well understood and trivial to implement. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 06, 2026
Ciphertext tampering in the Cloak Elixir encryption library (danielberkompas/cloak, all versions from 0.1.0-pre onward) lets anyone with write access to the encrypted store silently flip bits in stored ciphertext so that decryption returns an attacker-chosen plaintext of the same length. The affected code paths, Cloak.Ciphers.AES.CTR and Cloak.Ciphers.Deprecated.AES.CTR, encrypt with AES-256 in CTR mode and store the key tag, IV, and ciphertext with no MAC, and decrypt/2 validates only the key tag and a minimum length - so tampered data is returned as valid with no error. Exploitation requires write access to the ciphertext (the description cites SQL injection into the Ecto-backed database or a compromised replica) plus knowledge or a correct guess of the existing plaintext at the tampered offset, and the replacement value must be exactly the same length as the original; impact is integrity-only (VC:N/VA:N), with no public exploit identified at time of analysis. Note the vendor CVSS 4.0 score of 8.2 is driven entirely by VI:H, while an independent assessment applying CVSS 3.1 (AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N) rates the realistic risk considerably lower because an attacker must already control writes to the encrypted store and have plaintext knowledge.
RemediationAI
Apply the upstream fix commit 2bd17019e285b55c5c218cc842537bf9280f24c3 from danielberkompas/cloak (upstream fix available as a commit/PR; a released patched version number is not independently confirmed in the available data), and in the interim move security-relevant encrypted fields off the unauthenticated CTR ciphers onto an AEAD cipher such as AES-GCM, which appends an authentication tag so that any modification to the stored ciphertext causes decryption to fail rather than returning attacker-controlled plaintext - note this requires re-encrypting existing data and keeping the deprecated CTR cipher registered only for the migration window, since legacy CTR values remain forgeable while they can still be read. Because the attacker's entry point is write access to the ciphertext store, close the cited SQL injection vector with parameterized queries and strict allow-listing (a single unpatched injection route completely defeats the AEAD migration), and reduce the blast radius by running the application with a least-privilege DB account in which the encrypted columns are append-only or otherwise not updatable by the request-serving role, restricting replica write/read access to trusted operators, and enabling database audit logging or row-level integrity checks to detect out-of-band modifications. Full-text advisory details are at https://cna.erlef.org/cves/CVE-2026-95105.html and https://osv.dev/vulnerability/EEF-CVE-2026-95105; where the affected value must remain unauthenticated, consider storing a separate HMAC-SHA-256 over the ciphertext in an independent column that the writer role cannot modify, though this adds schema and key-management overhead.
Affected VersionsENISA
Affects your stack
Find out whether the stacks and servers you run are on an affected version.
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Cloak is an Elixir library that integrates transparent encryption with Ecto, exposing Cloak.EncryptedField / Cloak.EncryptedBinary Ecto types backed by pluggable ciphers. The vulnerable cipher, Cloak.Ciphers.AES.CTR, generates a random 16-byte IV, initializes an :aes_ctr keystream with a configured AES-256 key, and serializes its output as a one-byte key tag concatenated with the IV and the ciphertext (key_tag <> iv <> ciphertext); decrypt/2 pattern-matches that layout, resolves the key from the tag, and only checks that the key tag is known and that the length is sufficient. Because CTR is a stream cipher, the ciphertext is simply the plaintext XORed with a keystream that is a pure function of (key, IV), so any bit modified in the stored ciphertext produces an identical modification in the decrypted plaintext at the same offset - this is the classic bit-flipping attack against unauthenticated encryption. The root cause maps to CWE-649, Reliance on Obfuscation or Encryption of Security-Relevant Inputs without Integrity Checking: the design uses encryption for confidentiality but adds no message authentication code (MAC) or AEAD tag, so integrity is never verified. Cloak.Ciphers.Deprecated.AES.CTR decrypts the legacy ciphertext format the same way and inherits the same weakness. The CVSS 4.0 vector published by the vendor (AT:P - attack requirements present) and the independent CVSS 3.1 vector (AC:H) both encode the same precondition: the adversary must already be able to write to the encrypted column or replica and must know the current plaintext to compute the desired XOR delta.
Know when Cloak gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N
Exploitation needs pre-existing write access to the ciphertext store plus known plaintext, conditions outside attacker control, so AC:H; impact is integrity-only (I:H), with no confidentiality or availability effect.
Primary rating from Vendor (EEF).
CVSS VectorVendor: EEF
DescriptionCVE.org
Reliance on Obfuscation or Encryption of Security-Relevant Inputs without Integrity Checking vulnerability in danielberkompas cloak allows an attacker with write access to stored ciphertext to make it decrypt to a chosen value via bit flipping.
Cloak.Ciphers.AES.CTR encrypts with AES-256 in CTR mode and stores the key tag, the IV and the ciphertext with no MAC. decrypt/2 checks only the key tag and the minimum length before it returns the plaintext, and Cloak.Ciphers.Deprecated.AES.CTR decrypts the legacy format the same way. CTR is a stream cipher, so a value XORed into the stored ciphertext is XORed into the plaintext at the same offset. An attacker who can write to the encrypted store (for example through SQL injection or a compromised replica) and who knows or can guess a stored plaintext can replace it with any value of the same length. The application receives that value with no error.
This issue affects cloak: from 0.1.0-pre onward.
Executive ViewAI
The Cloak Elixir encryption library (all versions from 0.1.0-pre onward) contains a ciphertext tampering vulnerability that allows attackers with write access to the encrypted data store to silently alter decrypted plaintext without detection, affecting data integrity for applications relying on Cloak's AES-256 CTR ciphers. No vendor-released patch identified at time of analysis, and no public exploit identified at time of analysis, but the high severity (CVSS 8.2) and preconditions (write access plus plaintext knowledge) mean organizations should prioritize compensating controls and migration planning to protect sensitive data from undetected manipulation.
No vendor-released patch identified at time of analysis; restrict write access to encrypted stores, implement application-level HMAC integrity checks, migrate to authenticated encryption (e.g., AES-GCM), and enforce parameterized queries to prevent SQL injection.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
SQL injection exploits the way applications construct database queries by mixing user input directly into SQL statements.
EUVD-2026-93090
GHSA-hxq7-6hm2-6wvg
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB