fix(security): scope assignment update/delete/sync writes by user_id — defense-in-depth (follow-up #123)#235
Conversation
…ser_id (defense-in-depth, #123) Follow-up to #123/#224. update_assignment, delete_assignment, and sync_to_google do a user_id-scoped SELECT and 404 a non-owned id before writing, so they are not exploitable today — but their write/delete filters were id-only, relying solely on that guard. Scope the writes by user_id too, so a future change to the read-guard can't silently reopen the IDOR (matches export_to_google). Tests assert the update/delete/sync write filters now carry user_id.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
frontend | 0cb7589 | Commit Preview URL Branch Preview URL |
Jun 14 2026, 03:35 AM |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThree write operations in ChangesIDOR Fix: user_id Scoping for Calendar Assignment Writes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Queued follow-up from the cross-PR review (not urgent — not exploitable today).
update_assignment,delete_assignment, andsync_to_googleeach do auser_id-scoped SELECT and 404 a non-owned id before writing, so an IDOR isn't reachable now. But their write/delete filters were id-only, leaning entirely on that read-guard. This scopes the writes byuser_idtoo (matchingexport_to_googlefrom #224), so the day someone refactors the guard they can't silently reopen the hole — "not exploitable today" → "can't become exploitable."Tests assert the update/delete/sync write filters now carry
user_id. Calendar suites green; ruff clean.Summary by CodeRabbit
Bug Fixes
Tests