Skip to content

Conversation

@geoffg-sentry
Copy link
Contributor

Issue Assignments GroupValidator.validate_assignedTo was still using ActorField, updated it to use the auth-check'd OwnerActorField to prevent the IDOR.

For the RuleSerializer, refactored its validate_owner for the duplicate auth check that OwnerActorField provides.

Updated the OpenAPI serializer too for docs:

  • OrganizationAlertRuleIndexPostSerializer
  • OrganizationAlertRuleDetailsPutSerializer
  • ProjectRulesPostSerializer
  • ProjectRuleDetailsPutSerializer

@geoffg-sentry geoffg-sentry requested review from a team as code owners January 26, 2026 19:10
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jan 26, 2026
@geoffg-sentry geoffg-sentry changed the title Update OwnerActorField usage, Update OwnerActorField usage, refactor RuleSerializer, OpenAPI serializers Jan 26, 2026
Copy link
Member

@ceorourke ceorourke left a comment

Choose a reason for hiding this comment

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

"Stamping" for the alert rules stuff, will tag an issue-ier person for the group details stuff.


def test_assign_team_not_member_of_when_open_membership_disabled(self) -> None:
"""
Test that a user cannot assign an issue to a team they are not a member of
Copy link
Member

Choose a reason for hiding this comment

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

Is this a change to the current behavior? As a user I'd expect to be able to reassign an issue to a more relevant team if it was mis-assigned. Arbitrarily tapping @roggenkemper to verify

Copy link
Member

Choose a reason for hiding this comment

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

i think open membership being disabled is the important thing to not here - it seems correct that if it is disabled, you can't assign tickets to people from other teams (though if this is true, we should think of a workaround)

Copy link
Contributor Author

@geoffg-sentry geoffg-sentry Jan 26, 2026

Choose a reason for hiding this comment

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

Hmm, that's a good point. I could revert some of this and we could call out in docs that team re-assignment is very intentional. Then gate that no-membership-reassignment so that only when you're on a team that has been assigned it now, that you can reassign it elsewhere.

Copy link
Contributor Author

@geoffg-sentry geoffg-sentry Jan 26, 2026

Choose a reason for hiding this comment

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

@roggenkemper The fix here was to prevent user1 in team1 from reassigning issues to team2 if they are not a member, which is currently possible. Not about assigning to individual members. The cause of some of the current test failures too I'll have to fix.

So what behavior do we want here? Generally speaking, if you're not a member of team2, you shouldn't be able to assign issues to them without team:admin. But if we want to explicitly allow for a not-a-member team assignment of an issue, I can revert and we can better document this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@roggenkemper H'okay, made some changes. A user can now reassign to a team they are not a member of, if its currently assigned to a team they are a member of. They cannot assign an issue to a team they are not a member of if it that object isn't assigned to one of their teams.

Copy link
Member

Choose a reason for hiding this comment

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

might be good to check with someone else but i was under the impression open membership being off meant a user shouldn't be able to see the other teams in their organization, unless they are in it (this assumption could be wrong).

Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Copy link
Member

@wmak wmak left a comment

Choose a reason for hiding this comment

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

LGTM

@geoffg-sentry geoffg-sentry merged commit b6526b6 into master Jan 28, 2026
65 checks passed
@geoffg-sentry geoffg-sentry deleted the issue-assign-auth-check branch January 28, 2026 19:33
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.

5 participants