CVE-2025-48044: Authorization bypass when bypass policy condition evaluates to true
Summary Bypass policies incorrectly authorize requests when their condition evaluates to true but their authorization checks fail and no other policies apply.
Impact Resources with bypass policies can be accessed without proper authorization when: - Bypass condition evaluates to true - Bypass authorization checks fail - Other policies exist but their conditions don't match
Details Vulnerable code in: lib/ash/policy/policy.ex:69
elixir {%{bypass?: true}, condexpr, completeexpr}, {oneconditionmatches, allpoliciesmatch} -> { b(condexpr or oneconditionmatches), # <- Bug: uses condition only b(completeexpr or allpoliciesmatch) }
The final authorization decision is: oneconditionmatches AND allpoliciesmatch
When a bypass condition is true but bypass policies fail, and subsequent policies have non-matching conditions:
1. oneconditionmatches = condexpr (bypass condition) = true (bug - should check if bypass actually authorizes) 2. allpoliciesmatch = (completeexpr OR NOT condexpr) for each policy - For non-matching policies: (false OR NOT false) = true (policies don't apply) 3. Final: true AND true = true (incorrectly authorized)
The bypass condition alone satisfies "at least one policy applies" even though the bypass fails to authorize.
Fix Replace condexpr with completeexpr on line 69: elixir {%{bypass?: true}, condexpr, completeexpr}, {oneconditionmatches, allpoliciesmatch} -> { b(completeexpr or oneconditionmatches), # <- Fixed b(completeexpr or allpoliciesmatch) }
Line 52 should also be updated for consistency (though it's only triggered when bypass is the last policy, making it coincidentally safe in practice): elixir {%{bypass?: true}, condexpr, completeexpr}, {oneconditionmatches, true} -> { b(completeexpr or oneconditionmatches), # <- For consistency completeexpr }
PoC elixir policies do bypass always() do authorizeif actorattributeequals(:isadmin, true) end
policy actiontype(:read) do authorizeif always() end end
Non-admin user can perform create actions (should be denied).
Test demonstrating the bug: elixir test "bypass policy bug" do policies = [ %Ash.Policy.Policy{ bypass?: true, condition: [{Ash.Policy.Check.Static, result: true}], # condition = true policies: [ %Ash.Policy.Check{ type: :authorizeif, check: {Ash.Policy.Check.Static, result: false}, # policies = false checkmodule: Ash.Policy.Check.Static, checkopts: [result: false] } ] }, %Ash.Policy.Policy{ bypass?: false, condition: [{Ash.Policy.Check.Static, result: false}], policies: [ %Ash.Policy.Check{ type: :authorizeif, check: {Ash.Policy.Check.Static, result: true}, checkmodule: Ash.Policy.Check.Static, checkopts: [result: true] } ] } ]
expression = Ash.Policy.Policy.expression(policies, %{}) assert expression == false # Expected: false (deny) # Actual on main: true (incorrectly authorized) end
Other sources
Incorrect Authorization vulnerability in ash-project ash allows Authentication Bypass. This vulnerability is associated with program files lib/ash/policy/policy.ex and program routines 'Elixir.Ash.Policy.Policy':expression/2.
This issue affects ash: from 3.6.3 before 3.7.1.
— MITRE
Incorrect Authorization vulnerability in ash-project ash allows Authentication Bypass. This vulnerability is associated with program files lib/ash/policy/policy.ex and program routines 'Elixir.Ash.Policy.Policy':expression/2.
This issue affects ash: from pkg:hex/ash@3.6.3 before pkg:hex/ash@3.7.1, from 3.6.3 before 3.7.1, from 79749c2685ea031ebb2de8cf60cc5edced6a8dd0 before 8b83efa225f657bfc3656ad8ee8485f9b2de923d.
— NVD
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
erlang/ashto a version that resolves this vulnerability.Fixed in 3.7.1 - Upgrade
Upgrade
pkg:hex/ashto a version that resolves this vulnerability.Fixed in 3.7.1 - Configuration
In lib/ash/policy/policy.ex, update the bypass policy expression logic by replacing uses of `cond_expr` with `complete_expr` (specifically: change `b(cond_expr or one_condition_matches)` to `b(complete_expr or one_condition_matches)`; also update the line 69 usage for consistency).
Elixir.Ash.Policy.Policy (lib/ash/policy/policy.ex) b(cond_expr or one_condition_matches) = b(complete_expr or one_condition_matches) - Configuration
Ensure the bypass expression uses `complete_expr` rather than the bypass condition `cond_expr`, so that bypass policies only contribute when their authorization checks succeed (i.e., replace `cond_expr` with `complete_expr` in the bypass policy branch).
Elixir.Ash.Policy.Policy (lib/ash/policy/policy.ex) b(complete_expr or one_condition_matches) = b(complete_expr or one_condition_matches)
Event History
Frequently Asked Questions
What is the severity of CVE-2025-48044?
CVE-2025-48044 has a high severity rating due to its potential for authentication bypass.
How do I fix CVE-2025-48044?
To fix CVE-2025-48044, update the ash-project to a version greater than 3.7.1.
What versions are affected by CVE-2025-48044?
CVE-2025-48044 affects ash versions from 3.6.3 up to, but not including, 3.7.1.
What type of vulnerability is CVE-2025-48044?
CVE-2025-48044 is categorized as an Incorrect Authorization vulnerability.
Can CVE-2025-48044 lead to unauthorized access?
Yes, CVE-2025-48044 allows for authentication bypass, potentially leading to unauthorized access.