Public: anyone can read this; the crew can change it.
A child forge's bill downloads only for its verified claimant or spawner #15016
Check · Review · Land · Live done — Landed and live in production.
A hosted child forge's bill now downloads only for a claimant who has proven that email address on this forge. This closes the #14765 finding: before, anyone could sign up with (or change their address to) the claimant's email, skip verification, and download the child's signed monthly ledger.
shipped production is serving it deploy 6dfa34b
2 earlier comments
A hosted child forge's bill now downloads only for a claimant who has proven that email address on this forge. This closes the #14765 finding: before, anyone could sign up with (or change their address to) the claimant's email, skip verification, and download the child's signed monthly ledger.
What changed
claimsBillinsrc/actions/forge_bill.tsnow also requiresemailVerified(db, user.id), on top of the address matching the claimant's. It takes the database as a new first argument.readBill(the API and page doors) goes through it, and so do the bill links on/settings,/forges,/settings/paymentsand the TUI bills screen. An unproven account gets the same 404 as a stranger and sees no link.- The new test in
test/forge-bill.test.tssets up a child claimed by[email protected]and registerserinon the parent with the address left unproven. It checks for 404 on both doors and no link on/settings. After the address is marked proven, the download answers 200. Without the fix, the first check got 200.
Not done
- Authorizing by account id: the issue asks for the account id or a verified email. I used the verified email, because the claim is made on the child forge and records only an address, not a parent account id.
- Spawner access: the spawner still gets 404, as before. The issue's title and risks assume the spawner can download, but on main they can't: the existing test asserts the person who made the child gets 404. Letting them in would widen access, so it should be its own decision.
- I could not record the plan on the issue: the
keep_plantool isn't available in this session.
Checks: bun scripts/gate.ts --fix (it rewrapped one comment, which is committed), bun x tsc --noEmit and bun scripts/design-lint.ts are clean. bun scripts/fast.ts named 2255 test files, too many to run here, so I ran the bill and forges-page suites instead: forge-bill, billing-links, tui-billing-links, billing-tui, billing-payments and the forges* tests, 91 tests across 15 files, with 0 failures. The forge's check runs the full suite on the push.
Try it: sign up with the address that claimed a hosted forge and leave it unproven, then open /forges/<name>/bill: it answers 404. Prove the address and it downloads.
🤖 Generated with Claude Code
A child forge's bill now downloads only for a claimant who has proven that email address on this forge. This fixes the #14765 finding: before, anyone could sign up with the claimant's address (or switch their own to it), skip verification and download the child's signed monthly ledger.
What changed
src/actions/forge_bill.ts:claimsBillnow takes the database and also requiresemailVerified(db, user.id), on top of the address match it already made. It is the single check behind the API and page doors (readBill) and every bill link:/settings,/forges,/settings/paymentsand the terminal's bills screen. An unproven account gets the same 404 as a stranger and sees no link.src/web/pages/bills.tsandsrc/web/pages/forges.tsonly pass the database through. Nothing new is shown, so the pull carries "No door:" and "No look:" commit lines for the gate.test/forge-bill.test.ts: a child is claimed by[email protected], and anerinaccount on the parent has that address unproven (resetVerification, what an email change does). Both doors answer 404 and/settingsshows no link. Once the address is marked proven, the download answers 200. Without the fix the first check gets 200.
Not done
- The issue asks for the account id or a verified email; this uses the verified email. The claim is made on the child forge and records only an address, so there is no parent account id to bind to.
- The person who made the child still gets 404. The issue assumes they have access, but on main they don't: the existing test asserts it. Letting them in would widen access and needs its own decision.
Checks
bun scripts/gate.tsexits 0;bun x tsc --noEmitandbun scripts/design-lint.tsare clean.bun scripts/fast.tsnamed 2255 test files, too many to run in the sandbox. I ran the bill and forges-page suites instead (forge-bill,billing-links,tui-billing-links,billing-tui,billing-paymentsand theforges*tests): 91 tests in 15 files, none failing. The forge runs the full check on the push.- The issue's plan wasn't kept: the
keep_plantool isn't available in this session.
Try it: sign up with the address that claimed a hosted forge, leave it unproven, and open /forges/<name>/bill: it answers 404. Prove the address and the bill downloads.
🤖 Generated with Claude Code
One check now backs every door (API, page, settings, forges, payments, terminal): the address must match and be proven here. The unproven account gets the same 404 and no link, so there is nothing new to see on a phone or without JavaScript. The test registers the squatter, resets verification, and checks 404 on both doors and no link, then 200 once proven. Next: (1) decide separately whether the spawner should get the bill, since the issue assumes it and main refuses it; (2) tidy the header comment in forge_bill.ts, whose lines are wrapped unevenly.
A hosted child forge's bill now downloads only for a claimant who has proven that email address on this forge. This closes the #14765 finding: before, anyone could sign up with (or change their address to) the claimant's email, skip verification, and download the child's signed monthly ledger.
What changed
claimsBillinsrc/actions/forge_bill.tsnow also requiresemailVerified(db, user.id), on top of the address matching the claimant's. It takes the database as a new first argument.readBill(the API and page doors) goes through it, and so do the bill links on/settings,/forges,/settings/paymentsand the TUI bills screen. An unproven account gets the same 404 as a stranger and sees no link.test/forge-bill.test.tssets up a child claimed by[email protected]and registerserinon the parent with the address left unproven. It checks for 404 on both doors and no link on/settings. After the address is marked proven, the download answers 200. Without the fix, the first check got 200.Not done
keep_plantool isn't available in this session.Checks:
bun scripts/gate.ts --fix(it rewrapped one comment, which is committed),bun x tsc --noEmitandbun scripts/design-lint.tsare clean.bun scripts/fast.tsnamed 2255 test files, too many to run here, so I ran the bill and forges-page suites instead:forge-bill,billing-links,tui-billing-links,billing-tui,billing-paymentsand theforges*tests, 91 tests across 15 files, with 0 failures. The forge's check runs the full suite on the push.Try it: sign up with the address that claimed a hosted forge and leave it unproven, then open
/forges/<name>/bill: it answers 404. Prove the address and it downloads.🤖 Generated with Claude Code
Closes #14966