Am I affected?

type your ash version to check

Description

Incorrect Authorization vulnerability in ash-project ash widens a relationship's parent(...) scoping filter to match unintended records when the referenced parent field cannot be resolved.

Loading a relationship whose filter references parent(...) resolves that expression against the parent record. resolve_parent_in_filter/3 (lib/ash/actions/read/relationships.ex) resolved an unresolvable parent reference (for example when the referenced field was not selected on the source query) to nil rather than failing. A scoping predicate such as org_id == parent(org_id) then becomes an IS NULL match, and a guard like is_nil(parent(org_id)) or org_id == parent(org_id) activates its unrestricted branch, so the relationship returns records the scope was meant to exclude. The fix fails the read with an error when a parent(...) reference cannot be resolved, instead of defaulting to nil.

This issue affects ash: from 3.13.2 before 3.32.2.

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 ↗

3.13.2 < 3.32.2 affected
every other version: unaffected
cpe cpe:2.3:a:ash-project:ash:*:*:*:*:*:*:*:*
modules · source files · routines
modules 'Elixir.Ash.Actions.Read.Relationships'
source files lib/ash/actions/read/relationships.ex
routines 'Elixir.Ash.Actions.Read.Relationships':resolve_parent_in_filter/3 · 'Elixir.Ash.Actions.Read.Relationships':do_per_record_no_attributes_load/5

Affected — GitHub / ash-project/ash Repository ↗

0ddff26 < e52dad2 affected
every other version: unaffected
cpe cpe:2.3:a:ash-project:ash:*:*:*:*:*:*:*:*
modules · source files · routines
modules 'Elixir.Ash.Actions.Read.Relationships'
source files lib/ash/actions/read/relationships.ex
routines 'Elixir.Ash.Actions.Read.Relationships':resolve_parent_in_filter/3 · 'Elixir.Ash.Actions.Read.Relationships':do_per_record_no_attributes_load/5

References

Credits

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

CVSS breakdown

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