Skip to content

Commit

Permalink
dont allow self targeting for set-perms (#434)
Browse files Browse the repository at this point in the history
Signed-off-by: GitHub <[email protected]>
  • Loading branch information
metal0 authored Dec 27, 2023
1 parent e5e5746 commit f17232e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/src/api/guilds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export function initGuildsAPI(app: express.Express) {
if (type !== ApiPermissionTypes.User) {
return clientError(res, "Invalid type");
}
if (!isSnowflake(targetId)) {
if (!isSnowflake(targetId) || targetId === req.user!.userId) {
return clientError(res, "Invalid targetId");
}
const validPermissions = new Set(Object.values(ApiPermissions));
Expand Down

0 comments on commit f17232e

Please sign in to comment.