From ac84e39a6e4d081cd1e1f8bff1a3e94b4ba71d0e Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Wed, 18 Jan 2023 04:44:42 -0500 Subject: [PATCH] *validate pubkey length --- src/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/index.ts b/src/index.ts index 22a626c..e67a192 100644 --- a/src/index.ts +++ b/src/index.ts @@ -69,6 +69,11 @@ async function handleDiscover(aq: ActiveQuery) { return; } + if (aq.callerInput.pubkey.length !== 32) { + aq.reject("pubkey must be 32 bytes"); + return; + } + if ( "options" in aq.callerInput && typeof aq.callerInput.options !== "object"