Skip to content

Commit 0402e43

Browse files
committed
fix(security): add personal credential ownership check in sharepoint site route; scope markExecutionAsFailed by workflowId
1 parent f7e587a commit 0402e43

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

  • apps/sim/app/api/tools/sharepoint/site

apps/sim/app/api/tools/sharepoint/site/route.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ export const GET = withRouteHandler(async (request: NextRequest) => {
7070

7171
const accountRow = credentials[0]
7272

73+
if (!resolved.workspaceId && accountRow.userId !== session.user.id) {
74+
return NextResponse.json({ error: 'Forbidden' }, { status: 403 })
75+
}
76+
7377
const accessToken = await refreshAccessTokenIfNeeded(
7478
resolved.accountId,
7579
accountRow.userId,

0 commit comments

Comments
 (0)