Fix IDOR vulnerability in saved_views API (Fixes #1761)#2045
Open
YUVRAJ-SINGH-3178 wants to merge 3 commits into
Open
Fix IDOR vulnerability in saved_views API (Fixes #1761)#2045YUVRAJ-SINGH-3178 wants to merge 3 commits into
YUVRAJ-SINGH-3178 wants to merge 3 commits into
Conversation
utksh1
requested changes
Jul 24, 2026
utksh1
left a comment
Owner
There was a problem hiding this comment.
This saved-views IDOR branch has merge conflicts and overlaps the active saved-view ownership work. Please rebase onto current main, resolve against the current migration sequence, and add two-owner API regression coverage before re-review.
utksh1
requested changes
Jul 24, 2026
utksh1
left a comment
Owner
There was a problem hiding this comment.
This saved-views IDOR branch has merge conflicts and overlaps the active saved-view ownership work. Please rebase onto current main, resolve against the current migration sequence, and add two-owner API regression coverage before re-review.
YUVRAJ-SINGH-3178
force-pushed
the
fix-1761-saved-views-idor
branch
from
July 24, 2026 13:14
97f75ad to
e62ecde
Compare
Contributor
Author
|
I've updated the PR with the following fixes:
|
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.
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_viewsAPI so everything is strictly scoped to the authenticated user.Here's what I did:
owner_idcolumn to thesaved_viewstable and made theUNIQUEconstraint apply to(owner_id, name)instead of just globally on the name.database.pythat will upgrade the schema and backfill existing views to a default owner so older setups don't break.get_current_ownerauth dependency into all the routes insaved_views.pyand updated every single SQL query (SELECT, INSERT, UPDATE, DELETE) to useWHERE owner_id = ?.Users can now only touch their own stuff. Let me know if you want any changes!