aboutsummaryrefslogtreecommitdiffstats
path: root/routes/payments.ts
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-07 22:59:21 -0700
committerAdam Soltys <[email protected]>2026-08-07 23:29:25 -0700
commitd513ab75131bfaa16b1f0820d0fb18ad9e7f6ab1 (patch)
treebe028867721f69a1dc102e33b999cd6abdebf522 /routes/payments.ts
parent9f99bbdb765fc70373943930d543ce1cde7a5f35 (diff)
downloadcoinos-server-d513ab75131bfaa16b1f0820d0fb18ad9e7f6ab1.tar.gz
coinos-server-d513ab75131bfaa16b1f0820d0fb18ad9e7f6ab1.zip
auth: fail closed on adminpass, scrub sample secrets (S3)
The master-password path (isAdmin = password === config.adminpass) logs in as any user, skipping password, 2FA, and captcha. Worse, when adminpass is unset an omitted password field made undefined === undefined true, authenticating as anyone. Require both the configured value and the supplied password to be non-empty and match exactly, across every adminpass comparison (login, recaptcha bypass, support email, freeze). Also scrub config.ts.sample: the sample shipped a working-looking JWT secret, two server nsec keys, and adminpass "pwa". Replace with fail-closed placeholders and regenerate instructions. Rotate any deployment that ever shipped the sample values. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Diffstat (limited to 'routes/payments.ts')
-rw-r--r--routes/payments.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/routes/payments.ts b/routes/payments.ts
index 9751b421..4f0e7f6e 100644
--- a/routes/payments.ts
+++ b/routes/payments.ts
@@ -625,7 +625,7 @@ export default {
body: { secret },
} = req;
try {
- if (secret !== config.adminpass) fail("unauthorized");
+ if (!config.adminpass || secret !== config.adminpass) fail("unauthorized");
await s("freeze", true);
res.send("ok");
} catch (e) {