Skip to content

fix(issues): Scope get_shared_for_org to the slug-resolved organization#114906

Draft
oioki wants to merge 1 commit intomasterfrom
fix/shared-issue-cross-org-bypass
Draft

fix(issues): Scope get_shared_for_org to the slug-resolved organization#114906
oioki wants to merge 1 commit intomasterfrom
fix/shared-issue-cross-org-bypass

Conversation

@oioki
Copy link
Copy Markdown
Member

@oioki oioki commented May 5, 2026

IssueService.get_shared_for_org checked the disable_shared_issues flag on the org resolved from the URL slug, but fetched the group purely by share UUID with no org filter. A caller could pass a slug for org B (sharing enabled) alongside a share UUID that belongs to org A (sharing disabled) and receive org A's protected group title and message — bypassing the owning org's explicit privacy control.

The sibling method get_shared_for_cell already handles this correctly by checking the flag on the group's actual owning org. This PR makes get_shared_for_org consistent with that pattern:

  1. Fetch the group by share UUID first.
  2. Reject if the group's owning org doesn't match the slug-resolved org (new check).
  3. Reject if the owning org has disable_shared_issues set (moved from checking the wrong org).

Also adds unit tests for DatabaseBackedIssueService.get_shared_for_org covering the happy path, same-org sharing disabled, cross-org slug mismatch (the bypass), and cross-org slug mismatch with sharing disabled on the owner.

get_shared_for_org checked the disable_shared_issues flag on the org
resolved from the URL slug, but fetched the group purely by share UUID
with no org filter. A caller could pass a slug for org B (sharing
enabled) with a share UUID that belongs to org A (sharing disabled),
and receive org A's protected group title and message.

The fix fetches the group first, then rejects the request if the
group's owning org does not match the slug-resolved org, and finally
checks the flag on the actual owning org — matching the correct
pattern already used by get_shared_for_cell.

Co-Authored-By: Claude <[email protected]>
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label May 5, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 5, 2026

Backend Test Failures

Failures on 8d697b7 in this run:

tests/sentry/seer/migrations/test_0009_genericize_night_shift_results.py::GenericizeNightShiftResultsMigrationTest::testlog
Test passed but took too long to run: Duration 126.73650203199998s > 120.0s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant