From d7897af137fa4c2ebbaf5d19cbcc16660b277aa1 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Sun, 4 Dec 2022 01:01:13 -0500 Subject: [PATCH] *Prevent recursive broadcast_request --- src/modules/plugins/rpc.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/modules/plugins/rpc.ts b/src/modules/plugins/rpc.ts index d005a1f..1df1014 100644 --- a/src/modules/plugins/rpc.ts +++ b/src/modules/plugins/rpc.ts @@ -93,6 +93,13 @@ const plugin: Plugin = { throw new Error("relays required"); } + if ( + req?.request?.module === "rpc" && + req?.request?.method === "broadcast_request" + ) { + throw new Error("recursive broadcast_request calls are not allowed"); + } + let resp = await broadcastRequest(req.request, req.relays); const result: RPCBroadcastResponse = {