Am I affected?

type your ash version to check

Description

Incorrect Authorization vulnerability in ash-project ash allows an actor to read, update and destroy records that a policy forbids.

When a policy check cannot be decided up front or as a filter, Ash.Policy.Authorizer (lib/ash/policy/authorizer/authorizer.ex) runs its check/4 callback, which returns the records the check is true for. scenario_applies_to_record?/3 and scenario_impossible_by_data?/3 only asked whether a record was among them and ignored the value the policy needed. A policy that needs the check to be false, as forbid_if and authorize_unless do, therefore allowed exactly the records the check is true for and forbade the rest. Reads returned the records they should hide, and from 3.33.0 an update or destroy of a forbidden record succeeded.

This issue affects ash: from 3.4.44 before 3.39.0.

Weaknesses & attack patterns

Weakness

CWE-863 · Incorrect Authorization in catalog → MITRE ↗

Attack patterns

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

An actor reads, updates or destroys records that a forbid_if or authorize_unless policy should keep from them, while the records the policy allows are refused.

Affected — Hex / ash Hex.pm ↗ Repository ↗

≥ 3.4.44 < 3.39.0 affected
every other version: unaffected
cpe cpe:2.3:a:ash-project:ash:*:*:*:*:*:*:*:*
version type semver
modules · source files · routines
modules 'Elixir.Ash.Policy.Authorizer'
source files lib/ash/policy/authorizer/authorizer.ex
routines 'Elixir.Ash.Policy.Authorizer':scenario_applies_to_record?/3 · 'Elixir.Ash.Policy.Authorizer':scenario_impossible_by_data?/3

Affected — GitHub / ash-project/ash Repository ↗

≥ f4a8ff5 < dd17596 affected
every other version: unaffected
cpe cpe:2.3:a:ash-project:ash:*:*:*:*:*:*:*:*
version type git
modules · source files · routines
modules 'Elixir.Ash.Policy.Authorizer'
source files lib/ash/policy/authorizer/authorizer.ex
routines 'Elixir.Ash.Policy.Authorizer':scenario_applies_to_record?/3 · 'Elixir.Ash.Policy.Authorizer':scenario_impossible_by_data?/3

Workarounds

Write the check for the opposite condition and use it with authorize_if or forbid_unless, which are decided correctly.

Configurations

Reachable when a policy needs a check to be false for a record to be allowed (forbid_if, authorize_unless, or a policy condition) and that check is decided against the records: a custom check whose strict_check/3 returns :unknown under access_type :runtime, a filter check whose auto_filter/3 returns :unknown, or an expr(...) check that a runtime policy leaves to the records.

References

Credits

Glenn Rempe Finder Reporter Remediation developer
Zach Daniel / Ash Project Remediation reviewer

CVSS breakdown

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

Exploitability

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
None

Vulnerable System

Confidentiality
High
Integrity
High
Availability
None

Subsequent Systems

Confidentiality
None
Integrity
None
Availability
None
« All CVEs