{"id":"CVE-2026-95105","aliases":["CVE-2026-95105","EEF-CVE-2026-95105"],"related":[],"kind":"vulnerability","state":"published","title":"Cloak AES-CTR cipher lacks ciphertext authentication, allowing chosen-plaintext forgery by bit flipping","summary":"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.\n\nCloak.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.\n\nThis issue affects cloak: from 0.1.0-pre onward.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.\n\nCloak.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.\n\nThis issue affects cloak: from 0.1.0-pre onward.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nReliance 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.\n\n`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.\n\nThis issue affects cloak: from 0.1.0-pre onward.\n\n## Proof of concept\n\n1. Encrypt `\"role=user \"` with `Cloak.Ciphers.AES.CTR.encrypt/2` and a random 32-byte key.\n2. Without the key, XOR the last 10 bytes of the result (the ciphertext body) with `:crypto.exor(\"role=user \", \"role=admin\")`. Leave the key tag and the IV unchanged.\n3. Call `Cloak.Ciphers.AES.CTR.decrypt/2` on the modified value. It returns `{:ok, \"role=admin\"}`.\n\n## Impact\n\nAn attacker who can write to the encrypted store can set encrypted fields with known or guessable contents, such as roles, flags, or fixed-format records, to values of their choice without the key. The application decrypts and trusts the forged value.\n\n## Workarounds\n\nConfigure the vault with `Cloak.Ciphers.AES.GCM` as the default cipher and re-encrypt existing values, for example with the `cloak.migrate.ecto` task from cloak_ecto. Then remove `Cloak.Ciphers.AES.CTR` and `Cloak.Ciphers.Deprecated.AES.CTR` from the vault configuration, so that ciphertext in the CTR format is no longer decrypted. AES-GCM authenticates the ciphertext and rejects modified values.","format":"markdown","source":"eef"}],"published":"2026-10-06T08:37:56.987Z","modified":"2026-11-25T17:23:11.340Z","severity":{"scorer":"EEF","scheme":"CVSS:4.0","vector":"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","score":8.2,"rating":"HIGH"},"severities":[{"scorer":"EEF","scheme":"CVSS:4.0","vector":"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","score":8.2,"rating":"HIGH"},{"scorer":"Erlang Ecosystem Foundation","scheme":"CVSS:4.0","vector":"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"}],"cwes":["CWE-649"],"affected":[{"ranges":[{"type":"semver","introduced":"0.1.0-pre","fixed":"*","status":"affected"}],"vendor":"danielberkompas","product":"cloak","package":"cloak","cpe":"cpe:2.3:a:danielberkompas:cloak:*:*:*:*:*:*:*:*","repo":"https://github.com/danielberkompas/cloak","source":"cvelist"},{"ranges":[{"type":"git","introduced":"2bd17019e285b55c5c218cc842537bf9280f24c3","fixed":"*","status":"affected"}],"vendor":"danielberkompas","product":"cloak","package":"danielberkompas/cloak","cpe":"cpe:2.3:a:danielberkompas:cloak:*:*:*:*:*:*:*:*","repo":"https://github.com/danielberkompas/cloak","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0.1.0-pre","status":"affected"}],"ecosystem":"Hex","package":"cloak","purl":"pkg:hex/cloak","source":"eef"},{"ranges":[{"type":"git","introduced":"2bd17019e285b55c5c218cc842537bf9280f24c3","status":"affected"}],"repo":"https://github.com/danielberkompas/cloak","source":"eef"}],"references":[{"url":"https://cna.erlef.org/cves/CVE-2026-95105.html","tags":["exploit","related","third-party-advisory","web"],"sources":["cvelist","eef","nvd"]},{"url":"https://osv.dev/vulnerability/EEF-CVE-2026-95105","tags":["related"],"sources":["cvelist","nvd"]},{"url":"https://github.com/danielberkompas/cloak/commit/2bd17019e285b55c5c218cc842537bf9280f24c3","tags":["related","web"],"sources":["cvelist","eef","nvd"]},{"url":"https://hex.pm/packages/cloak","tags":["package"],"sources":["eef"]}],"credits":["Peter Ullrich","Jonatan Männchen / EEF"],"assigner":"EEF","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-10-06T11:37:58.212Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-95105","url":"https://www.cve.org/CVERecord?id=CVE-2026-95105","licence":"CVE Terms of Use","modified":"2026-11-19T08:23:02.881Z"},{"source":"eef","name":"Erlang Ecosystem Foundation","id":"EEF-CVE-2026-95105","url":"https://osv.dev/vulnerability/EEF-CVE-2026-95105","licence":"CC-BY-4.0","modified":"2026-11-25T17:23:11.340Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-95105","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-95105","licence":"Public domain","modified":"2026-10-06T15:03:59.427Z"}],"updatedAt":"2026-11-25T22:59:42.273Z","epss":{"score":0.00132,"percentile":0.03002,"date":"2026-12-01T12:00:22.000Z"}}