From 0a7fca68dd6be73d71c209a1e195a86982fb7d17 Mon Sep 17 00:00:00 2001 From: SI Date: Thu, 4 Apr 2024 02:16:55 +0200 Subject: [PATCH] ensure that the flag field is formatted as CCTF{...}, otherwise treat it as invalid --- flag_encoder/index.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/flag_encoder/index.html b/flag_encoder/index.html index a15c5df..6f2a92f 100644 --- a/flag_encoder/index.html +++ b/flag_encoder/index.html @@ -27,6 +27,8 @@ var s = inpFlag.value; var k = new BN(0); var h = "0x"; + if (s.slice(0, 5) !== "CCTF{" || s.slice(-1) !== "}") + return null; for (i in s) { var c = s.charCodeAt(i); k = k.muln(16).addn(c);