Skip to content

fix(tag): validate object access in tag create/delete commands#19

Open
hbrooks wants to merge 7 commits into
masterfrom
demo/pr-40329
Open

fix(tag): validate object access in tag create/delete commands#19
hbrooks wants to merge 7 commits into
masterfrom
demo/pr-40329

Conversation

@hbrooks

@hbrooks hbrooks commented May 28, 2026

Copy link
Copy Markdown

sha174n and others added 7 commits May 21, 2026 12:35
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants