Miggo Logo

CVE-2025-48043: Ash Framework: Filter authorization misapplies impossible bypass/runtime policies

N/A

CVSS Score

Basic Information

EPSS Score
0.21183%
Published
10/13/2025
Updated
10/13/2025
KEV Status
No
Technology
TechnologyErlang

Technical Details

CVSS Vector
-
Package NameEcosystemVulnerable VersionsFirst Patched Version
asherlang< 3.6.23.6.2

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from two separate flaws in the Ash framework's filter-based authorization logic, which could lead to unauthorized data access. I analyzed the provided patch commit to pinpoint the exact locations of these flaws.

  1. Bypass Policy Flaw in Ash.Policy.Policy.compile_policy_expression/1: The description highlighted that bypass policies with conditions that can never be true at runtime were being miscompiled. The patch for lib/ash/policy/policy.ex confirms this. The original code used an OR condition that included a NOT of the bypass condition. This meant that if the bypass condition was false, the policy would become permissive. The fix introduces a specific check for bypass? and generates a stricter AND expression, removing the vulnerability. The vulnerable function is the private function compile_policy_expression/1 within the Ash.Policy.Policy module.

  2. Empty Scenario Flaw in Ash.Policy.Authorizer: The second issue was that runtime policy scenarios that resulted in no applicable checks were being dropped, again leading to a permissive filter. The patch in lib/ash/policy/authorizer/authorizer.ex shows a new check, if scenario == %{}, which explicitly adds a false condition to the filter. This ensures that an impossible scenario correctly filters out all results. By inspecting the file structure, I identified that this logic resides within the build_filter/2 private function, which is responsible for constructing the final query filter.

Both identified functions are directly involved in processing authorization rules and constructing the data access filters. An exploit would involve a read operation on a resource where a misconfigured authorization policy (either a bypass or a runtime check) triggers one of these flawed logic paths, causing the database query to return more data than the user is authorized to see.

Vulnerable functions

Ash.Policy.Policy.compile_policy_expression/1
lib/ash/policy/policy.ex
The function `compile_policy_expression/1` incorrectly compiled `bypass` policies. The original logic, `{:or, {:and, condition_expression, compiled_policies}, {:not, condition_expression}}`, created a permissive filter when a bypass condition could never be true at runtime. The `NOT(condition)` branch would evaluate to true, effectively bypassing the intended policy.
Ash.Policy.Authorizer.build_filter/2
lib/ash/policy/authorizer/authorizer.ex
Within the `Ash.Policy.Authorizer` module, the logic for building authorization filters did not properly handle empty SAT scenarios (where `scenario == %{}`). Instead of treating this as a failed check (`false`), it was dropped, leading to an overly permissive filter. This could allow unauthorized data to be returned if a runtime policy check resulted in an empty scenario.

WAF Protection Rules

WAF Rule

### Summ*ry W**n usin* ***ilt*r** *ut*oriz*tion, two **** **s*s *oul* **us* t** poli*y *ompil*r/*ut*oriz*r to **n*r*t* * p*rmissiv* *ilt*r: *. ***yp*ss poli*i*s w*os* *on*ition **n n*v*r p*ss *t runtim*** w*r* *ompil** *s `OR(*N*(*on*ition, *omp

Reasoning

T** vuln*r**ility st*ms *rom two s*p*r*t* *l*ws in t** *s* *r*m*work's *ilt*r-**s** *ut*oriz*tion lo*i*, w*i** *oul* l*** to un*ut*oriz** **t* ****ss. I *n*lyz** t** provi*** p*t** *ommit to pinpoint t** *x**t lo**tions o* t**s* *l*ws. *. ***yp*ss