From 1eb8b5d97e8b58920951aa7bcc9f9f92bd69a6b5 Mon Sep 17 00:00:00 2001 From: SI Date: Fri, 5 Apr 2024 02:26:00 +0200 Subject: [PATCH] test the contestant address field for validity --- flag_encoder/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flag_encoder/index.html b/flag_encoder/index.html index 1070c07..025b272 100644 --- a/flag_encoder/index.html +++ b/flag_encoder/index.html @@ -45,7 +45,7 @@ } else { outpObscuredFlag.value = addressFromKey(k); var m = inpContestantAddress.value; - if (m.slice(0, 2) !== "0x") { + if (!/^0x[0-9a-fA-F]{40}$/.test(m)) { outpSignature.value = ""; } else { outpSignature.value = signMessage(m, k);