deleted#4
Closed
jechol wants to merge 1 commit into
Closed
Conversation
The Policy Refactoring (ash-project#2365) introduced a bug where bypass policies were contributing only their condition to one_condition_matches instead of their complete expression (condition AND policies). This caused bypass policies with always-true conditions (like always()) to incorrectly satisfy the "at least one policy applies" requirement even when the bypass policies themselves failed. For example, with these policies: - bypass always() do authorize_if actor_attribute_equals(:is_admin, true) - policy action_type(:read) do authorize_if always() A non-admin user performing a create action would be incorrectly authorized because: 1. bypass condition (always) was true → one_condition_matches = true 2. policy condition (action_type(:read)) was false 3. Final: true AND (tautology) = true (incorrect!) The fix restores the old behavior where bypass policies contribute their complete expression to one_condition_matches, ensuring that a bypass only satisfies the requirement if it actually authorizes. Fixes authorization bypass when bypass conditions are always true but bypass policies fail.
c11b477 to
394b5cc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
deleted