Am I affected?

type your ash version to check

Description

Improper Access Control vulnerability in ash-project ash lets a create action overwrite an existing record when the ETS or Mnesia data layer is used, because neither enforced primary-key uniqueness on insert.

Unlike a SQL data layer, whose unique primary-key constraint rejects a duplicate, the ETS and Mnesia data layers implemented create as a keyed insert that replaces any existing entry with the same primary key (lib/ash/data_layer/ets/ets.ex, lib/ash/data_layer/mnesia/mnesia.ex). An actor who can set the primary key on a create (for example a user-supplied string or integer key) can submit a create whose key matches an existing record and silently overwrite it, destroying and replacing another entity's data without going through the update action or its policies. The fix rejects a create whose primary key already exists with an already-taken error, and only allows duplicates for keyless resources.

This issue affects ash: from 0.4.0 before 3.32.2.

Weaknesses & attack patterns

Weakness

CWE-284 · Improper Access Control in catalog → MITRE ↗

Attack patterns

CAPEC-1 · Accessing Functionality Not Properly Constrained by ACLs MITRE ↗

Affected — Hex / ash Hex.pm ↗ Repository ↗

0.4.0 < 3.32.2 affected
every other version: unaffected
cpe cpe:2.3:a:ash-project:ash:*:*:*:*:*:*:*:*
modules · source files · routines
modules 'Elixir.Ash.DataLayer.Ets' · 'Elixir.Ash.DataLayer.Mnesia'
source files lib/ash/data_layer/ets/ets.ex · lib/ash/data_layer/mnesia/mnesia.ex
routines 'Elixir.Ash.DataLayer.Ets':create/2 · 'Elixir.Ash.DataLayer.Mnesia':create/2

Affected — GitHub / ash-project/ash Repository ↗

6dc699d < 912e243 affected
every other version: unaffected
cpe cpe:2.3:a:ash-project:ash:*:*:*:*:*:*:*:*
modules · source files · routines
modules 'Elixir.Ash.DataLayer.Ets' · 'Elixir.Ash.DataLayer.Mnesia'
source files lib/ash/data_layer/ets/ets.ex · lib/ash/data_layer/mnesia/mnesia.ex
routines 'Elixir.Ash.DataLayer.Ets':create/2 · 'Elixir.Ash.DataLayer.Mnesia':create/2

References

Credits

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

CVSS breakdown

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