From 2cd28723c0a5eb80168668d2f4f9ce4c38e4fea3 Mon Sep 17 00:00:00 2001 From: Sebastian Malton Date: Tue, 9 Nov 2021 12:31:32 -0500 Subject: [PATCH] Check length Signed-off-by: Sebastian Malton --- src/main/proxy-functions/shell-api-request.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/proxy-functions/shell-api-request.ts b/src/main/proxy-functions/shell-api-request.ts index e431ffad4a..cdc91a2f18 100644 --- a/src/main/proxy-functions/shell-api-request.ts +++ b/src/main/proxy-functions/shell-api-request.ts @@ -65,7 +65,7 @@ export class ShellRequestAuthenticator extends Singleton { const authToken = clusterTokens.get(tabId); const buf = Uint8Array.from(Buffer.from(token, "base64")); - if (authToken instanceof Uint8Array && crypto.timingSafeEqual(authToken, buf)) { + if (authToken instanceof Uint8Array && authToken.length === buf.length && crypto.timingSafeEqual(authToken, buf)) { // remove the token because it is a single use token clusterTokens.delete(tabId);