Am I affected?

type your ash version to check

Description

Incorrect Authorization vulnerability in ash-project ash allows an actor to infer data in related records they cannot read via Ash.count/2, Ash.exists/2 and Ash.aggregate/3.

Ash.Actions.Aggregate.run/4 (lib/ash/actions/aggregate.ex) applied only the root resource's read policy before running the aggregate query. The read path also applies each related resource's read policy to filter and sort references that cross a relationship, directly (for example comments.body) or through an aggregate over one, but the aggregate path skipped that step. A caller whose filter or sort reaches these functions, for example through Ash.Query.filter_input/2, an ash_lua script, or an AshAi tool offering count or exists results, can test conditions against related rows hidden from them and recover their existence and attribute values one query at a time. Ash.read/2 and its page counts are not affected.

This issue affects ash: from 2.6.0 before 3.34.6.

Weaknesses & attack patterns

Weakness

CWE-863 · Incorrect Authorization in catalog → MITRE ↗

Attack patterns

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

Affected — Hex / ash Hex.pm ↗ Repository ↗

≥ 2.6.0 < 3.34.6 affected
every other version: unaffected
cpe cpe:2.3:a:ash-project:ash:*:*:*:*:*:*:*:*
version type semver
modules · source files · routines
modules 'Elixir.Ash.Actions.Aggregate' · 'Elixir.Ash'
source files lib/ash/actions/aggregate.ex · lib/ash.ex
routines 'Elixir.Ash.Actions.Aggregate':run/4 · 'Elixir.Ash':count/2 · 'Elixir.Ash':exists/2 · 'Elixir.Ash':aggregate/3

Affected — GitHub / ash-project/ash Repository ↗

≥ 30eaf1c < 8093618 affected
every other version: unaffected
cpe cpe:2.3:a:ash-project:ash:*:*:*:*:*:*:*:*
version type git
modules · source files · routines
modules 'Elixir.Ash.Actions.Aggregate' · 'Elixir.Ash'
source files lib/ash/actions/aggregate.ex · lib/ash.ex
routines 'Elixir.Ash.Actions.Aggregate':run/4 · 'Elixir.Ash':count/2 · 'Elixir.Ash':exists/2 · 'Elixir.Ash':aggregate/3

Configurations

Reachable only when an application passes caller-supplied filters or sorts that cross a relationship into Ash.count/2, Ash.exists/2 or Ash.aggregate/3 (directly, through ash_lua read operations, or through AshAi count, exists or aggregate result types), and a related resource's read policy is stricter than the root resource's.

References

Credits

Glenn Rempe Reporter Finder
Zach Daniel / Ash Project Remediation developer

CVSS breakdown

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