Am I affected?

type your ash version to check

Description

Ash field_policies are documented to protect against filter-based information disclosure: when a field the actor may not see is referenced in a filter, it is replaced with an expression that evaluates to nil, so a filter cannot be used as a yes/no oracle to read a value the actor cannot see.

This nilling was applied to attributes but not to calculations or aggregates. A user-supplied filter reference to a calculation or aggregate carries an Ash.Query.Calculation / Ash.Query.Aggregate struct, which the authorizer's reference replacement did not match (it only matched the Ash.Resource.* structs), so the filter ran against the real value.

As a result, an actor whose field policies forbid a calculation or aggregate can still filter by it (for example filter(secret_calc == "x") or filter(comment_count == n)) and learn the value from whether rows match — an oracle that recovers field-policy-protected values one probe at a time. Filtering is commonly exposed to lower-privileged actors (for example via AshGraphql or AshJsonApi filter arguments), which is exactly the surface field policies are meant to protect.

The fix routes filter references to calculations and aggregates through the same field-policy nilling as attributes.

This issue affects ash: from 2.11.0-rc.0 before 3.33.4.

Weaknesses & attack patterns

Weakness

CWE-1220 · Insufficient Granularity of Access Control in catalog → MITRE ↗

Attack patterns

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

Affected — Hex / ash Hex.pm ↗ Repository ↗

2.11.0-rc.0 < 3.33.4 affected
every other version: unaffected
cpe cpe:2.3:a:ash-project:ash:*:*:*:*:*:*:*:*
modules · source files · routines
modules 'Elixir.Ash.Policy.Authorizer'
source files lib/ash/policy/authorizer/authorizer.ex
routines 'Elixir.Ash.Policy.Authorizer':do_replace_ref/2

Affected — GitHub / ash-project/ash Repository ↗

0b6d93c < b3d4503 affected
every other version: unaffected
cpe cpe:2.3:a:ash-project:ash:*:*:*:*:*:*:*:*
modules · source files · routines
modules 'Elixir.Ash.Policy.Authorizer'
source files lib/ash/policy/authorizer/authorizer.ex
routines 'Elixir.Ash.Policy.Authorizer':do_replace_ref/2

Configurations

Reachable only when an application uses Ash.Policy.Authorizer field policies to restrict a calculation or aggregate, and exposes filtering on it to an actor who is denied that field (for example an authenticated user filtering through AshGraphql or AshJsonApi).

References

Credits

Jesse Williams Reporter Finder
Zach Daniel / Ash Project Remediation developer
Jonatan Männchen / EEF Coordinator

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