CVE-2026-140867 PUBLISHED

Aggregates in Ash skip the read policies of the records they read on several query paths, disclosing counts and values of hidden records

Assigner: EEF
Reserved: 03.12.2026 Published: 04.12.2026 Updated: 04.12.2026

Incorrect authorization vulnerability in Ash allows an actor to read counts, sums and attribute values of related records they cannot read via aggregates.

Ash.Actions.Read (lib/ash/actions/read/read.ex) authorized an aggregate in two passes. Ash.Filter.relationship_filters/7 built a policy filter for each relationship it found an aggregate reading, and authorize_aggregate/11 looked each filter up and applied none when it found none. An aggregate the first pass did not reach ran without its destination's read policy. That covered an aggregate or calculation given as the field: of Ash.aggregate/3, the aggregates inside a calculation used as an aggregate's field, an aggregate in another aggregate's filter, sort or join filter, and an aggregate in a combination or in the sort of an atomic bulk update or destroy. Ash.count/2, Ash.exists/2 and Ash.aggregate/3 also ignored a read policy that is decided against the records, and an aggregate reached on these paths over a multitenant resource required no tenant.

This issue affects ash: from 2.17.22 before 3.39.1.

Metrics

CVSS Vector: 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
CVSS Score: 5.9

Product Status

Vendor ash-project
Product ash
Versions Default: unaffected
  • affected from 2.17.22 to 3.39.1 (excl.)
Vendor ash-project
Product ash
Versions Default: unaffected
  • affected from a12131cf70872e33d881c2c7c5d65cf9d2b5fb34 to 42ee4418dfc968c1c5779dd928c878822f88a866 (excl.)

Affected Configurations

Reachable when a resource has an aggregate over a relationship whose destination has a stricter read policy than the resource itself, and one of these holds: a caller can choose the field or the query: of an aggregate given to Ash.aggregate/3 (directly, through ash_lua read operations, or through the AshAi aggregate result type); the application defines an aggregate whose field is a calculation that uses an aggregate; or a caller can filter or sort on an aggregate that is the field, filter or sort of another aggregate. Ash.count/2, Ash.exists/2 and Ash.aggregate/3 over a resource whose own read policy is decided against the records are affected without further conditions.

Credits

  • Glenn Rempe finder
  • Glenn Rempe reporter
  • Glenn Rempe remediation developer
  • Paul Schoenfelder remediation developer
  • Glenn Rempe remediation reviewer
  • Zach Daniel / Ash Project remediation reviewer

References

Problem Types

  • CWE-863 Incorrect Authorization CWE

Impacts

  • An actor who may read a record asks for an aggregate over its related records, through Ash.aggregate/3, a stacked aggregate, or a filter or sort on one, and receives counts, sums or attribute values of related records that their read policy hides. Filtering an aggregate on a guessed value makes it a yes or no oracle for any attribute of a hidden record.