From dd2375e427abb3a991bd7a37a348ef6d7382af89 Mon Sep 17 00:00:00 2001 From: legonzaur Date: Wed, 29 Mar 2023 09:44:09 +0200 Subject: [PATCH] Fix creation of kills to a different server exploit --- src/db/db.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/db/db.ts b/src/db/db.ts index 443a024..667f06c 100644 --- a/src/db/db.ts +++ b/src/db/db.ts @@ -65,7 +65,7 @@ export async function CreateServer({ //tokens are stored in raw... maybe we should use something better in the future //Using callback for express-basic-auth export function CheckServerToken( - this: { body: any }, + this: { params: any, body: any }, name: string, password: string, cb: (error: Error | null, success: boolean) => void @@ -75,7 +75,8 @@ export function CheckServerToken( .where('token', '=', password) .executeTakeFirst() .then((result) => { - cb(null, !!result) + if (name != this.params.serverId) return cb(null, false) + return cb(null, !!result) }) } /*