fix: use authenticated user ID for bin operations instead of client-supplied dj_id#178
Open
jakebromberg wants to merge 3 commits intomainfrom
Open
fix: use authenticated user ID for bin operations instead of client-supplied dj_id#178jakebromberg wants to merge 3 commits intomainfrom
jakebromberg wants to merge 3 commits intomainfrom
Conversation
…upplied dj_id All bin endpoints accepted dj_id from the request body/query, enabling any authenticated DJ to read/modify any other DJ's bin (IDOR). Co-authored-by: Cursor <cursoragent@cursor.com>
7672983 to
efc36bc
Compare
added 2 commits
February 27, 2026 09:46
Bin endpoints now derive dj_id from req.auth.id instead of accepting it from the client. Remove dj_id from request bodies and query params in integration tests, and remove tests for missing dj_id validation since it is no longer a client-supplied parameter. Also update requirePermissions middleware to decode (without verifying) the JWT in AUTH_BYPASS mode so that req.auth.id is still populated for controllers that depend on it.
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.
Summary
addToBin,deleteFromBin,getBin) accepteddj_idfrom the client request body/query parameters, allowing any authenticated DJ to read or modify any other DJ's bin.req.auth!.id!(the verified JWT payload) instead of trusting client-supplied values. Thedj_idparameter validation checks are removed since the ID is no longer user-supplied.tests/unit/controllers/djs.bin-idor.test.tswith three tests verifying that whenreq.auth.id = 'user-A'and the request suppliesdj_id = 'user-B', the service layer receives'user-A'.Test plan
req.auth.idover client-supplieddj_idMade with Cursor