Skip to content

Fix IDOR vulnerability in saved_views API (Fixes #1761)#2045

Open
YUVRAJ-SINGH-3178 wants to merge 1 commit into
utksh1:mainfrom
YUVRAJ-SINGH-3178:fix-1761-saved-views-idor
Open

Fix IDOR vulnerability in saved_views API (Fixes #1761)#2045
YUVRAJ-SINGH-3178 wants to merge 1 commit into
utksh1:mainfrom
YUVRAJ-SINGH-3178:fix-1761-saved-views-idor

Conversation

@YUVRAJ-SINGH-3178

@YUVRAJ-SINGH-3178 YUVRAJ-SINGH-3178 commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Hey! This PR fixes the IDOR vulnerability reported in #1761.

Previously, anyone could mess with other users' saved views by guessing the view ID. To fix this, I completely locked down the saved_views API so everything is strictly scoped to the authenticated user.

Here's what I did:

  • Database: Added an owner_id column to the saved_views table and made the UNIQUE constraint apply to (owner_id, name) instead of just globally on the name.
  • Migration: Wrote a seamless startup migration in database.py that will upgrade the schema and backfill existing views to a default owner so older setups don't break.
  • API Lockdown: Injected the get_current_owner auth dependency into all the routes in saved_views.py and updated every single SQL query (SELECT, INSERT, UPDATE, DELETE) to use WHERE owner_id = ?.

Users can now only touch their own stuff. Let me know if you want any changes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant