aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* app: recognise onion pages relayed by the UI without a client IPAdam Soltys27 hours1-2/+14
| | | | | | | | | | | Onion requests never pass Cloudflare, so the UI has no cf-connecting-ip to forward when it relays them server-side, and they stopped being marked as Tor. Password logins from the onion site then failed the captcha check. Treat a request from the ui peer whose forwarded Host is an onion address as Tor, and key it on the Tor gateway's address. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VMan6SSfVopM1ZzXKZmLYU
* auth: write rejected logins of disabled accounts to an audit fileAdam Soltys2 days2-12/+20
| | | | | | | | | | | A script replaying tokens for many disabled accounts flooded the container log with one line per request. Record each rejection (username, source IP, how many repeats were suppressed) in logs/evicted-auth.jsonl instead, still throttled per account to one entry every ten minutes, and keep logs/ out of git. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VMan6SSfVopM1ZzXKZmLYU
* auth: lock PIN checks after ten wrong PINs in an hourAdam Soltys2 days3-4/+71
| | | | | | | | | | | | | Every PIN check answered right or wrong with no per-account limit (POST /pin, the sends that require a PIN, and the settings update), so anyone holding a stolen session could try every 6-digit PIN from rotating IPs. checkPin() now counts wrong PINs per account in pinfail:<id>; after ten in an hour every PIN check fails, the right PIN included, until the hour is up. A missing PIN doesn't count, and the right PIN clears the count. POST /pin answers 429 while locked. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VMan6SSfVopM1ZzXKZmLYU
* rate limits: key per-account limits on the user, add them to on-chain sendsAdam Soltys2 days2-17/+30
| | | | | | | | | | | | | The token-keyed limits on /lightning/quote and GET /invoice/:id used the first 50 characters of the Authorization header, which are the same for every JWT, so all signed-in users shared one bucket. /lightning/quote now limits per user id (checked after auth), and GET /invoice/:id per IP like the other invoice routes. /bitcoin/fee and /bitcoin/send get a per-user limit of 10 a minute, and repeated fee-estimate failures log once per user per 10 minutes. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VMan6SSfVopM1ZzXKZmLYU
* users: unlink an anon account's pubkey only after the signature checks outAdam Soltys2 days1-2/+5
| | | | | | | | | | Updating your pubkey to one held by an anonymous account deleted that account's user:<pubkey> pointer before the signed challenge was verified, so a request with a bad signature still detached the key from its account. Do the unlink after verification succeeds. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VMan6SSfVopM1ZzXKZmLYU
* register: cap account creation over Tor at five an hourAdam Soltys2 days4-4/+91
| | | | | | | | | | | | | | Onion clients all arrive from the Tor gateway's address, so the per-IP and per-range signup caps either let them create unlimited accounts or would count unrelated internal traffic. Mark requests that came through Tor (including ones the UI's server-side rendering relays, which forward the client address in cf-connecting-ip) with req.isTor, and give them one shared quota of five new accounts an hour for /register and first-time nostr logins. The recaptcha bypass for onion users now uses the same flag instead of trusting the Host header. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VMan6SSfVopM1ZzXKZmLYU
* users: stamp v3migrated when an account hands its name to v3Adam Soltys3 days2-0/+8
| | | | | | | | | | | `migrated` has been set on every new account since 2023, so it can't tell the names registrar whether an account actually handed its name over. When the account's own session posts the hand-off, also record a server-set `v3migrated` timestamp, and include it in the public user fields so the registrar can require a fresh one before granting the name. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VMan6SSfVopM1ZzXKZmLYU
* meltguard: report cap-refused pays as failed so melts don't stick pendingAdam Soltys9 days1-2/+33
| | | | | | | | | | | | | | A pay refused for the per-melt or rolling cap never reaches cl, so listpays returns nothing for its hash. nutshell 0.22 treats that as NOT_FOUND and keeps the melt quote PENDING with the proofs locked indefinitely. Record cap-refused hashes in GUARD_DIR/rejected and answer a listpays for one of them with a failed pay when cl has none, so the mint marks the quote unpaid and releases the proofs. cl's own answer still wins when it has a pay for the hash. Repeat-hash and partial refusals are not recorded. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VMan6W9CsdxmhFrfaKNVHU
* funds: say "Funds have been discontinued" when refusing a fund actionAdam Soltys9 days1-1/+1
| | | | | Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VMan6W9CsdxmhFrfaKNVHU
* funds: include archived and pre-rotation history in GET /fund/:idAdam Soltys9 days1-4/+20
| | | | | | | | | | | A fund's older payments live in the archive, and funds whose id was rotated keep that history under their previous id, so the fund page only showed the most recent entries. Merge the live and archived lists for both ids (fund:rotatedFrom:<id> maps a rotated fund back to its previous id) and sort newest first. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VMan6W9CsdxmhFrfaKNVHU
* funds: serve fund history to anyone; close manager changesAdam Soltys9 days1-13/+14
| | | | | | | | | | Funds are closed and every value-moving route refuses, so a rotated fund's old id now resolves to its history for any viewer, read-only. Adding and removing managers is refused as well, so a fund without managers can't be claimed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VMan6W9CsdxmhFrfaKNVHU
* mint: one pay per invoice hash, refuse MPP melts, gate a retired keysetAdam Soltys10 days2-11/+134
| | | | | | | | | | | meltguard refuses repeat and partial pays for a payment hash and can apply its cap as a rolling window. mintdemux refuses melt quotes with MPP or amountless options or an unparseable invoice, and only lets ecash from a gated keyset be spent if its DLEQ blinding factor traces it to an allowed mint operation. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VMan6SEnsbshZrUDtTsxAX
* nwc: floor the default routing fee cap at 5 satsAdam Soltys10 days1-2/+8
| | | | | | | | 1% rounds to zero below 50 sats, which rejected small zaps whose route costs a sat. Unused fee is refunded. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VMan6SEnsbshZrUDtTsxAX
* names: ignore registrar records held by blocked keysAdam Soltys10 days3-1/+40
| | | | | | | | | Names whose v3 record belongs to a key in names:blocked_holders are treated as unclaimed: lightning address, NIP-05 and legacy forwarding stay with the local account. Fails open if the registrar or db cannot answer. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VMan6SEnsbshZrUDtTsxAX
* remove the Shopify webhook integration; add a migration kill switchAdam Soltys10 days4-9/+6
| | | | | | | | | Drop the /shopify route and the shopify user fields. POST /user with `migrated` fails while migrate:disabled is set, which stops the UI migration hand-off before the registrar grant is issued. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VMan6SEnsbshZrUDtTsxAX
* webhooks, zaps: send user-supplied URLs through the SSRF guardAdam Soltys10 days4-23/+81
| | | | | | | | | | Invoice webhooks must be plain http(s) strings and are posted with safePost (checked, pinned address, no redirects). Zap requests resolve the recipient lud16/lud06 and callback through safeGot instead of fetching them as-is. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VMan6SEnsbshZrUDtTsxAX
* confirm: accept only canonical txids from the node notify scriptsAdam Soltys10 days2-1/+56
| | | | | | | | | | Lowercase and validate the txid so a mixed-case txid cannot slip past the case-sensitive dedupe keys, refuse requests that came through Cloudflare or the onion, and require the TCP peer to be a node container or loopback so internal relays cannot reach it either. Validate type and wallet. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VMan6SEnsbshZrUDtTsxAX
* payments: hold Lightning deposits back from on-chain withdrawalAdam Soltys10 days6-71/+501
| | | | | | | | | | | | | | | | While hold:enabled is set, Lightning deposits above a daily free allowance are held: they can still be spent over Lightning or sent internally, but not withdrawn on-chain or over Lightning into our own on-chain liquidity. The check and release run inside the atomic debit script, internal transfers carry the hold to the receiver, and old holds expire via scripts/holds.ts. The listener notes which peer each deposit arrived from for review. sendOnchain now refuses frozen accounts before building the transaction or locking its inputs, so a frozen account retrying withdrawals cannot hold hot-wallet UTXOs and make other sends fail with locked outputs. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VMan6SEnsbshZrUDtTsxAX
* sendOnchain: grow the blocked-address list from mule accounts onlyAdam Soltys2026-11-131-1/+31
| | | | | | | | | | | An account caught sending to a blocked address is frozen and added to a `mules` set, and a mule's withdrawal destinations are blocked too, so a drain operator's fresh accounts are stopped on their first sweep. A plain blacklist freeze doesn't feed the list: frozen accounts are often takeover victims, and blocking their owner's own address locks the owner out after the account is recovered. Wallet-owned outputs (change) are never matched. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* ecash: answer a missing token with a plain errorAdam Soltys2026-11-131-1/+1
| | | | Co-Authored-By: Claude Opus 5.5 <[email protected]>
* app: recognise onion requests that arrive through lbAdam Soltys2026-11-131-2/+10
| | | | | | | | | The onion service points at lb rather than the app, so the socket peer is lb and the tor check never matched; the client's own cf-connecting-ip and x-forwarded-for headers were trusted. Also check the last x-forwarded-for hop (which lb overwrites with its own peer) and pin the client IP to it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* lnurl: fetch user-supplied URLs through the SSRF guard, relay only protocol ↵Adam Soltys2026-11-137-10/+134
| | | | | | | | | | | | | fields Lightning address sends (pay() and POST /send/<lnaddr>) now validate the name and domain and fetch through safeGot instead of plain got. Zap receipt relays from the zap request must resolve to public hosts. The LNURL decode and proxy routes return only LNURL protocol fields instead of whatever JSON the upstream sent, and the proxy logs failures rate-limited with a generic error to the client. Also blocks the 172.42.0.0/16 docker range. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* v3forward: a registrar 404 means nobody holds the nameAdam Soltys2026-11-051-0/+7
| | | | | | | | The registrar answers 404 for a name that can't exist on v3, such as a legacy username with spaces. Treat it as unheld, and cache it like one, instead of logging a failed check on every receive. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* login: tell the client when an account's password was resetAdam Soltys2026-11-041-0/+11
| | | | | | | | | A rekeyed account holds the literal "reset" instead of a hash, so no password can match. Return "account reset" so the client can send the owner to support. The check runs after the captcha and the per-IP failure cap, and counts as a failure. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* changeid: carry the remaining uid-keyed lists to the new idAdam Soltys2026-11-041-0/+6
| | | | | Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VMan6VN9xvnX1cgvV6hrUV
* self-delete: use the full delall sweep, require the PINAdam Soltys2026-11-042-79/+165
| | | | | | | | | | | POST /delete now runs lib/deluser, the same sweep as scripts/delall.ts: it also disables the account's bolt12 offers on the node, removes the invoice pointer keys (invoice:<hash|text|offer_id>), covers sub-account invoices and deletes from the archive too. Offers are disabled before any key is deleted, so an unreachable node aborts with the account intact. Accounts with a PIN must now send it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* users: ignore pubkey on signup, revoke a rekeyed account's nostr keyAdam Soltys2026-11-023-3/+24
| | | | | Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VMan6VN9xvnX1cgvV6hrUV
* changeid: keep a frozen or evicted account frozen under its new idAdam Soltys2026-11-021-0/+5
| | | | | Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VMan6VN9xvnX1cgvV6hrUV
* mintdemux: split restore requests by keyset between the old and new mintsAdam Soltys2026-11-021-2/+23
| | | | | Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VMan6VN9xvnX1cgvV6hrUV
* payments: cap the routing fee a lightning send may reserveAdam Soltys2026-11-021-0/+11
| | | | | Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VMan6VN9xvnX1cgvV6hrUV
* payments: credit each on-chain output once and require uuid invoice idsAdam Soltys2026-11-023-0/+27
| | | | | Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01VMan6VN9xvnX1cgvV6hrUV
* apps: require a hex NWC pubkey and return only public fields for payment usersAdam Soltys2026-10-291-1/+8
| | | | | | | | | The app pubkey names both the app record and its payment list, so a non-key value could point a connection at another account's payments. Reject anything but a 64-character hex key on create and lookup, and trim the user attached to each payment to the public profile fields. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* register: check the reCAPTCHA v3 score, action and hostname; cap signups per ↵Adam Soltys2026-10-292-8/+196
| | | | | | | | | | | | | | | network siteverify answers success for any validly minted v3 token, so success alone let scripted signups through. Signup now needs the register action and a 0.5 score, and login 0.3. A token minted for another site is refused. The web signup page must send a token. Signups are capped per IPv4 /16 or IPv6 /48, hourly and daily, and those keeping the auto-filled animal+NN username are capped site-wide per hour. Turnstile is verified and logged only, on trial. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NfM8zA4DdKvW1316z4zCaD
* payments: refuse a lightning send over the balance before quoting its routeAdam Soltys2026-10-291-1/+8
| | | | | | | | | A retrying client against an empty account cost an askrene query per attempt. debit() stays the authoritative check. Route-quote failures are also rate-limited in the log per user. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NfM8zA4DdKvW1316z4zCaD
* users: open pre-NIP-49 nostr keys with the account passwordAdam Soltys2026-10-293-5/+78
| | | | | | | | | Older accounts keep their nostr key as a password-encrypted seed (cipher + salt) rather than a NIP-49 nsec, so the reveal and signing paths treated them as having no key. On a verified password, /login and /nsec now convert it to a NIP-49 nsec, and hasnsec counts it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* lnquote: keep the quote layer until a timed-out getroutes is doneAdam Soltys2026-10-291-5/+24
| | | | | | | | | askrene queues getroutes calls beyond its child limit and only checks layer names when they arrive. Removing the quote layer after our RPC timeout left a queued request pointing at a missing layer, which trips an assert that takes lightningd down. Delay the removal when getroutes never answered. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* docker: ghcr.io/coinos/bun, oven/bun with the distrusted emSign G3 root ↵Adam Soltys2026-10-212-21/+31
| | | | | | | | | swapped out bun-distrust.ts now carries the root's DER itself instead of finding it through tls.getCACertificates, so it works on any bun image. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* base: bun-distrust leaves the binary alone when there's nothing to replaceAdam Soltys2026-10-211-2/+4
| | | | Co-Authored-By: Claude Opus 5.5 <[email protected]>
* base: take emSign ECC Root CA - G3 out of bun's built-in root storeAdam Soltys2026-10-212-0/+44
| | | | | | | | | | Bun compiles Mozilla's roots into its binary and NODE_USE_SYSTEM_CA only adds to them, so the fixed Debian ca-certificates doesn't reach fetch/tls. docker/bun-distrust.ts overwrites the root's DER in place with a same-length self-signed placeholder (key discarded) at image build time. Drop it once a bun release removes the root itself. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* base: bun 1.3.11 → 1.4.3Adam Soltys2026-10-211-1/+1
| | | | Co-Authored-By: Claude Opus 5.5 <[email protected]>
* base: pin bun to 1.3.11 so rebuilding the image (fresh ca-certificates for ↵Adam Soltys2026-10-211-1/+3
| | | | | | the emSign CA compromise) doesn't also upgrade bun Co-Authored-By: Claude Opus 5.5 <[email protected]>
* users: let a password unlock the encrypted nostr key for any sessionAdam Soltys2026-10-132-0/+34
| | | | | | | | | | /me only reports hasnsec now, so sessions that didn't start with a password login had no way to reveal or sign with their key. POST /nsec returns it after re-checking the password, under the login per-IP failure limit. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01UjHzoBmW1iPpEe5qC2LDYB
* login: drop the unused per-username failure counterAdam Soltys2026-10-131-7/+0
| | | | | | | | | The counter was incremented on every failed login and read but never acted on; the per-IP limits do the throttling. Its keys never expired and had grown to most of the keyspace. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01UjHzoBmW1iPpEe5qC2LDYB
* bolt12: put the requested expiry and single-use on the offer itselfAdam Soltys2026-10-081-0/+9
| | | | | | | | The expiry was only stored on our invoice record, so CLN kept issuing invoices for the offer after it had expired. Pass it as absolute_expiry, and accept single_use to cap an offer at one payment. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* users: keep the encrypted nostr key and 2FA seed away from bearer tokensAdam Soltys2026-10-082-4/+15
| | | | | | | | /me and user emits return a hasnsec flag instead of the encrypted key, which is now only sent with a password login or registration. /otpsecret refuses once 2FA is enabled, and disabling 2FA rotates the seed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* analytics-geo: read rotated request log chunksAdam Soltys2026-10-081-6/+26
| | | | Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Remove response loggerAdam Soltys2026-10-081-19/+0
| | | | Co-Authored-By: Claude Opus 5.5 <[email protected]>
* me: stop reporting archived balance as locked for frozen accountsAdam Soltys2026-10-081-16/+1
| | | | Co-Authored-By: Claude Opus 5.5 <[email protected]>
* lightningd: bump to v26.06.9Adam Soltys2026-10-071-1/+1
| | | | Co-Authored-By: Claude Opus 5.5 <[email protected]>
* email: escape support form HTML and enforce recaptcha v3 scoreAdam Soltys2026-10-061-37/+56
| | | | | | | | Escape the message body, stop accepting a client-supplied subject, strip control characters from header values, require the expected action and a minimum score from siteverify, and drop the adminpass captcha bypass. Co-Authored-By: Claude Opus 5.5 <[email protected]>