fix(webapp): scope team-member removal to the caller's org#3842
Conversation
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThis PR fixes an organization-scoping vulnerability in the ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Hi @lissy93, thanks for your interest in contributing! This project requires that pull request authors are vouched, and you are not in the list of vouched users. This PR will be closed automatically. See https://github.com/triggerdotdev/trigger.dev/blob/main/CONTRIBUTING.md for more details. |
I did, about a month ago, in #3539 - but am still waiting 😭 |
Closes #nothing
✅ Checklist
Testing
pnpm run typecheck --filter webapppasses_app.orgs.$organizationSlug.settings.team/route.tsx): the renderedmemberIdalways comes from the org-scoped loader, so every legitimate request (self-leave or removing a same-org member) still matches and succeedsmemberIdnow resolves to no record; the delete throws P2025, which the route already catches and returns as a 400, so no crashChangelog
Scope
removeTeamMemberdeletes to the caller's organization, fixing a cross-org member-deletion IDORPreviously, a member of any org could delete a row from any other org, if they knew their id. And they do know their ID, since
OrgMember.idis rendered into a hidden form input on the team-settings page.Note that I previously opened this as a private PR about a month ago, here. But I think this is safe to open publicly, since it doesn't reveal the other steps needed to exploit the full account take over (which I documented in GHSA-58mc-m3qq-6qrh.
I submitted a vouch request in #3539 - could you take a look please?
Screenshots
N/A — server-side authorization fix
💯