From 470a92264d221d683a585502b6203519d4e170cc Mon Sep 17 00:00:00 2001 From: SI Date: Thu, 4 Apr 2024 02:34:13 +0200 Subject: [PATCH] allow only printable ASCII characters in flag strings --- flag_encoder/index.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flag_encoder/index.html b/flag_encoder/index.html index 37d4e8c..3f52701 100644 --- a/flag_encoder/index.html +++ b/flag_encoder/index.html @@ -30,6 +30,8 @@ return null; for (i in s) { var c = s.charCodeAt(i); + if (c < 32 || c > 126) + return null; h += c.toString(16).padStart(2, "0"); } return "0x" + new BN(keccak256(h).slice(2), 16).mod(secp256k1n).toString(16).padStart(64, 0);