Commit 3f4ec6e
fix(mcp): verify workspace ownership before revoking OAuth tokens
- DELETE /api/mcp/servers: pre-fetch with workspace filter and 404 before
calling revokeMcpOauthTokens so an attacker can't trigger revocation
against a serverId from another workspace.
- PATCH /api/mcp/servers/[id]: early-return 404 immediately after
currentServer lookup so shouldClearOauth/revoke logic never runs when
the server doesn't belong to the caller's workspace.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 4908b96 commit 3f4ec6e
2 files changed
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
108 | 116 | | |
109 | 117 | | |
110 | 118 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
359 | 373 | | |
360 | 374 | | |
361 | 375 | | |
| |||
0 commit comments