Check length

Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
Sebastian Malton committed 2021-11-09 12:31:32 -05:00
1 parent e92304b92e
commit 2cd28723c0
1 file changed
+1 -1
@@ -65,7 +65,7 @@ export class ShellRequestAuthenticator extends Singleton {
const authToken = clusterTokens.get(tabId); const authToken = clusterTokens.get(tabId);
const buf = Uint8Array.from(Buffer.from(token, "base64")); 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 // remove the token because it is a single use token
clusterTokens.delete(tabId); clusterTokens.delete(tabId);