Skip to content

fix(auth): Fix for impersonated sessions#109903

Merged
michelletran-sentry merged 1 commit intomasterfrom
feat/data-secrecy-impersonation-block
Mar 5, 2026
Merged

fix(auth): Fix for impersonated sessions#109903
michelletran-sentry merged 1 commit intomasterfrom
feat/data-secrecy-impersonation-block

Conversation

@michelletran-sentry
Copy link
Contributor

No description provided.

Impersonated superuser sessions bypass the data secrecy check because
is_active_superuser() returns False during impersonation, skipping
the get_superuser_scopes() path that enforces data secrecy. Add a
guard in both from_request_org_and_scopes() and from_request() to
check for request.actual_user and raise DataSecrecyError when the
target org has data secrecy enabled.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Mar 4, 2026
@michelletran-sentry michelletran-sentry marked this pull request as ready for review March 5, 2026 14:36
@michelletran-sentry michelletran-sentry requested a review from a team as a code owner March 5, 2026 14:36
Copy link
Contributor

@geoffg-sentry geoffg-sentry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well that's easier than expected

@michelletran-sentry michelletran-sentry merged commit 01db71e into master Mar 5, 2026
77 checks passed
@michelletran-sentry michelletran-sentry deleted the feat/data-secrecy-impersonation-block branch March 5, 2026 16:12
JonasBa pushed a commit that referenced this pull request Mar 5, 2026
Co-authored-by: Claude <noreply@anthropic.com>
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.

2 participants