From d8a361bdcfaa8cc5b39d9675e74b0e1d2e42be2c Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sun, 13 Sep 2026 20:44:48 -0700 Subject: security: drop the admin endpoint surface and land pending hardening Removes the admin-gated endpoints and the account flags they set, plus a batch of hardening that had accumulated uncommitted in the tree. These were deployed and verified together, so they land as one change. admin surface: - drop POST /hidepay, POST /unlimit and GET /users, their handlers, and the now-unused admin preValidation export - `unlimited` was only ever written, never read; `hidepay` only appeared in output projections. Both flags go, along with their whitelist, public-fields and type entries. request log: - redactBody now recurses. It only masked top-level keys, so a body that nests credentials one level down wrote them to the log in plaintext, and pin fields were not on the list at all. payments: - sendOnchain/build gate `aid` through requireAccount, so a caller can only spend from an account it owns - sendOnchain signs only a tx we composed, matched against a short-lived per-account build receipt - raise xpay retry_for to 60s; route-finding preferred a drained zero-fee hop and burned the whole budget on it. check()'s reversal window keeps its 2x margin. ecash / invoices / webhooks: - resolve a token's mint through the IP-pinning fetcher instead of plain fetch, closing an unauthenticated SSRF path into the internal network - reject non-positive amounts before the balance write - /sign requires the caller to own the address, rather than signing under any address the hot wallet controls - webhook delivery no longer disables TLS verification; the body carries the merchant's shared secret registration: - refuse a username the v3 registrar holds unless the caller's own nostr key is the holder (lib/names.ts) liquid: - honour the deposit kill switch at invoice generation and at credit elements image: - pin 23.3.4 and verify the release tarball checksum Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_0112TGi9GGNWqji1XQ5jZRzc --- index.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'index.ts') diff --git a/index.ts b/index.ts index 755aa827..b50b92de 100644 --- a/index.ts +++ b/index.ts @@ -1,5 +1,5 @@ import app from "$lib/app"; -import { admin, auth, optional } from "$lib/auth"; +import { auth, optional } from "$lib/auth"; import { fixBolt12, listenForLightning, ensureListenerAlive, replay } from "$lib/lightning"; import { startHealthCheck } from "$lib/health"; @@ -120,7 +120,6 @@ app.get("/accounts", auth, users.accounts); app.post("/accounts", auth, users.createAccount); app.post("/account/delete", auth, users.deleteAccount); -app.get("/users", auth, users.list); app.get("/me", auth, users.me); app.get("/ro", auth, users.ro); app.get("/credits", auth, users.credits); @@ -182,8 +181,6 @@ app.post("/items/sort", auth, items.sort); app.post("/shopify/:id", shopify); -app.post("/hidepay", admin, users.hidepay); -app.post("/unlimit", admin, users.unlimit); app.get("/bolt12", fixBolt12); app.get("/cash/:id/:version", ecash.get); -- cgit v1.2.3