From 02d032d6d0b03c94e16404d6d024f86282da3ee9 Mon Sep 17 00:00:00 2001 From: Jean Date: Sun, 5 Jul 2026 23:01:23 +0000 Subject: [PATCH] sandbox: split raw irc.send into its own irc-raw permission (not bundled with irc) --- src/modules/sandbox/protocol.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/modules/sandbox/protocol.ts b/src/modules/sandbox/protocol.ts index 9ec9d57..345a207 100644 --- a/src/modules/sandbox/protocol.ts +++ b/src/modules/sandbox/protocol.ts @@ -11,7 +11,11 @@ // on its own — the part that must never regress. /** Permissions an operator can grant a sandboxed plugin in config.json. */ -export const PERMISSIONS = ['irc', 'notify', 'storage'] as const; +// 'irc-raw' is deliberately separate from 'irc': the structured verbs (say/msg/ +// join/part/list) are far less dangerous than raw wire access (irc.send can issue +// ANY command as the user — MODE, KICK, QUIT, …), so an operator must grant it on +// purpose rather than getting it bundled with 'irc'. +export const PERMISSIONS = ['irc', 'irc-raw', 'notify', 'storage'] as const; export type Permission = (typeof PERMISSIONS)[number]; /** RPC methods the guest may call, mapped to the permission each one needs. @@ -19,7 +23,7 @@ export type Permission = (typeof PERMISSIONS)[number]; export const RPC_CAPABILITY: Record = { 'irc.say': 'irc', 'irc.msg': 'irc', - 'irc.send': 'irc', + 'irc.send': 'irc-raw', 'irc.join': 'irc', 'irc.part': 'irc', 'irc.list': 'irc',