Am I affected?

type your ash_cloak version to check

Description

Deserialization of Untrusted Data vulnerability in ash-project ash_cloak allows an attacker who can influence the bytes of an encrypted column to crash the BEAM node, by triggering unbounded atom creation or a decompression bomb during decryption.

AshCloak.Calculations.Decrypt decodes the decrypted binary with Ash.Helpers.non_executable_binary_to_term/1 without the :safe option, so atoms in the payload are interned during the decode and never garbage collected, and the term format's compressed form is inflated transparently. vault.decrypt!() is the only barrier and stops tampering only for an authenticated cipher. Cloak also ships the unauthenticated AES.CTR, whose ciphertext an attacker who knows their own plaintext can XOR into any same-length payload without the key, so an ordinary read of the forged column reaches the decoder. A few hundred kilobytes of distinct atoms exhausts the atom table, or a small compressed payload inflates to gigabytes.

This issue affects ash_cloak: from 0.1.0 before 0.4.0.

Weaknesses & attack patterns

Weakness

CWE-502 · Deserialization of Untrusted Data in catalog → MITRE ↗

Attack patterns

CAPEC-586 · Object Injection MITRE ↗

Affected — Hex / ash_cloak Hex.pm ↗ Repository ↗

0.1.0 < 0.4.0 affected
every other version: unaffected
cpe cpe:2.3:a:ash-project:ash_cloak:*:*:*:*:*:*:*:*
modules · source files · routines
modules 'Elixir.AshCloak.Calculations.Decrypt'
source files lib/ash_cloak/calculations/decrypt.ex
routines 'Elixir.AshCloak.Calculations.Decrypt':calculate/3

Affected — GitHub / ash-project/ash_cloak Repository ↗

f1595a7 < 1690f0a affected
every other version: unaffected
cpe cpe:2.3:a:ash-project:ash_cloak:*:*:*:*:*:*:*:*
modules · source files · routines
modules 'Elixir.AshCloak.Calculations.Decrypt'
source files lib/ash_cloak/calculations/decrypt.ex
routines 'Elixir.AshCloak.Calculations.Decrypt':calculate/3

Configurations

An application must use ash_cloak with an unauthenticated vault cipher (for example the AES.CTR cipher shipped by Cloak), or run in a deployment where the stored ciphertext can be modified, and read a cloaked field so the decrypt calculation runs.

References

Credits

Peter Ullrich Finder Reporter
Zach Daniel / Ash Project Remediation developer
Jonatan Männchen / EEF Coordinator

CVSS breakdown

CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
« All CVEs