From 66581fb62198b1c3c1a3d00d97f436c60d89dacd Mon Sep 17 00:00:00 2001 From: martbost Date: Fri, 20 Nov 2026 15:10:35 -0600 Subject: [PATCH] Public /api/config: no Telegram chat/topic ids, no spamScanAllow, no value holding an email address (seven member emails and the admin chat id were readable by anyone; admin pages read them through /api/admin/site) (2026-11-20) Co-Authored-By: Claude Opus 5.5 --- server.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index ec72245..531cc46 100644 --- a/server.js +++ b/server.js @@ -2594,7 +2594,11 @@ const server = http.createServer(async (req, res) => { const c = chain.getConfig(); // public copy of the site settings: never anything that looks like a credential const pubSite = {}; - for (const [k, v] of Object.entries(siteConfig())) if (!/secret|token|password|private|apikey|api_key/i.test(k) && !/^support/.test(k)) pubSite[k] = v; // support* = help desk internals (Marty's chat id, saved replies) + // also never: Telegram chat/topic ids, the link-farm allow list, or any value holding an email address (2026-11-20: spamScanAllow + // put seven member emails and telegramAdminChatId in this public answer; only the admin pages use them, through /api/admin/site) + const EMAIL = /[^\s@"]+@[^\s@"]+\.[a-z]{2,}/i; + for (const [k, v] of Object.entries(siteConfig())) if (!/secret|token|password|private|apikey|api_key/i.test(k) && !/^support/.test(k) + && !/^telegram|ChatId$|TopicId$|^spamScan/i.test(k) && !EMAIL.test(typeof v === 'string' ? v : JSON.stringify(v))) pubSite[k] = v; // support* = help desk internals (Marty's chat id, saved replies) return json(res, 200, Object.assign({ contract: c.contract, chainId: c.chainId, chainName: c.chainName, explorer: c.explorer, rpc: c.rpcs[0], emailAuth: mailer.hasKey() || !IS_PROD }, pubSite));