From 1e71c187df72fa1289190ebd97269b53648e7097 Mon Sep 17 00:00:00 2001 From: Minh-Phuc Tran <25026967+phuctm97@users.noreply.github.com> Date: Fri, 1 Oct 2021 17:31:49 +0700 Subject: [PATCH] Blacklist noncev2 namespace in v1 set --- routes/metadata.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/routes/metadata.js b/routes/metadata.js index 7d89e8e..9f49010 100644 --- a/routes/metadata.js +++ b/routes/metadata.js @@ -62,6 +62,11 @@ router.post( set_data: { data }, tableName, } = req.body; + + if (namespace === "noncev2") { + return res.status(400).json({ error: "noncev2 namespace is not allowed to be set", success: false }); + } + const key = constructKey(pubKeyX, pubKeyY, namespace); await knexWrite(tableName).insert({ key,