dont allow self targeting for set-perms (#434)
Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
parent
e5e574625a
commit
f17232e0c1
1 changed files with 1 additions and 1 deletions
|
@ -126,7 +126,7 @@ export function initGuildsAPI(app: express.Express) {
|
||||||
if (type !== ApiPermissionTypes.User) {
|
if (type !== ApiPermissionTypes.User) {
|
||||||
return clientError(res, "Invalid type");
|
return clientError(res, "Invalid type");
|
||||||
}
|
}
|
||||||
if (!isSnowflake(targetId)) {
|
if (!isSnowflake(targetId) || targetId === req.user!.userId) {
|
||||||
return clientError(res, "Invalid targetId");
|
return clientError(res, "Invalid targetId");
|
||||||
}
|
}
|
||||||
const validPermissions = new Set(Object.values(ApiPermissions));
|
const validPermissions = new Set(Object.values(ApiPermissions));
|
||||||
|
|
Loading…
Add table
Reference in a new issue