mirror of
https://github.com/barkeser2002/offline-db.git
synced 2026-09-25 00:59:54 +03:00
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
783 B
783 B
- Identify Vulnerability: In
apps/watchparty/views.py, theRoomViewSetinherits fromviewsets.ModelViewSetwhich allows any authenticated user to update or delete any room because there is no authorization check. This is an IDOR vulnerability. - Implement Fix: Create a custom permission class
IsHostOrReadOnly(or similar logic directly in the view) to enforce that only thehostof a room can modify or delete it. Alternatively, overrideperform_updateandperform_destroyto raisePermissionDeniedifrequest.user != instance.host. - Write/Run Tests: Run the existing test suite (using
USE_SQLITE=True pytest). Add a small test if necessary. - Pre-commit: Complete the required pre-commit checks.
- Submit: Create the PR for Sentinel.