aboutsummaryrefslogtreecommitdiff
path: root/src/lib/Utility/authorisation.test.ts
Commit message (Collapse)AuthorAgeFilesLines
* fix(security): authorize shadowHide target in badges endpoint (IDOR)Fuwn20 hours1-0/+20
PUT /api/badges?shadowHide=<userId> called setShadowHidden on an arbitrary user_id with no ownership/privilege check, so any logged-in user could flip shadow_hidden on another user's badges (e.g. un-hide moderator-hidden ones). The GraphQL path already guarded this; the REST twin didn't. Extract the owner-or-privileged check into a shared isOwnerOrPrivileged helper, use it in both the REST endpoint and the GraphQL resolver, and add a regression test.