fix(security): #113 — bind scheduleId to workspace (IDOR) - #124
Closed
HongmingWang-Rabbit wants to merge 1 commit into
Closed
fix(security): #113 — bind scheduleId to workspace (IDOR)#124HongmingWang-Rabbit wants to merge 1 commit into
HongmingWang-Rabbit wants to merge 1 commit into
Conversation
ScheduleHandler.Update and Delete previously filtered the WHERE clause on scheduleId alone, letting a member of workspace A mutate or delete a schedule row owned by workspace B if it knew the target UUID. Also fixes the same leak in the pre-update SELECT that read cron_expr and timezone across workspaces. All three queries now bind BOTH ":id" (from the wsAuth group) and ":scheduleId". Foreign rows return 404 with no leak. RunNow and History already had the correct two-key filter — no changes there. Two new tests drive a Bob→Alice attack via sqlmock: row counts come back zero, handler returns 404. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Author
Merged
7 tasks
This was referenced May 2, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #113 (HIGH severity — cross-workspace IDOR).
Root cause
`Update` and `Delete` on `workspace_schedules` filtered by `scheduleId` only. A member of workspace A with a cached scheduleId from workspace B could mutate or delete that foreign row — the `wsAuth` middleware only gates the :id path parameter, not the sub-resource.
Fix
Bind both :id and :scheduleId in every SQL that touches a schedule:
`RunNow` and `History` already had the correct two-key filter — no changes.
Test plan
🤖 Generated with Claude Code