fix(tag): validate object access in tag create/delete commands#19
Open
hbrooks wants to merge 7 commits into
Open
fix(tag): validate object access in tag create/delete commands#19hbrooks wants to merge 7 commits into
hbrooks wants to merge 7 commits into
Conversation
Add object access validation to both CreateCustomTagCommand and DeleteTaggedObjectCommand to prevent unauthorized tag operations on dashboards, charts, and queries that users don't have access to. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Treat None results from to_object_model() as explicit access denial rather than silently skipping authorization check. This prevents the bypass where DashboardAccessFilter returns None for unauthorized users, causing the security validation to be skipped entirely. The previous implementation allowed unauthorized users to create and delete tags on objects they cannot access because the conditional 'if target_object and hasattr...' would evaluate to False when target_object is None, silently skipping the raise_for_access() call.
- Use db.session.get() instead of DAO.find_by_id() in to_object_model to avoid DAO base filters that require request context - Allow tag deletion when the underlying object no longer exists - Handle missing request context gracefully in access checks Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
…hecks The previous behavior silently bypassed permission checks for objects returned filtered by the DAO; switching to direct model load now correctly skips both objects the alpha user does not own in the bulk_create scenario. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Mirror of apache/superset#40329 by @sha174n