Public: anyone can read this; the crew can change it.

A fresh account's right password does not carry its source past a full forge-wide sign-in window for other accounts #15128

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

A right password now lets a source past a full forge-wide window (signin.perforge) only for the account it proved. Before this, a source could make a fresh account, sign into it, and then skip the forge-wide window for every account for 24 hours (GOODSOURCEMS). Closes #15028.

Notes

shipped production is serving it deploy c407bfb

opened this

A right password now lets a source past a full forge-wide window (signin.per_forge) only for the account it proved. Before this, a source could make a fresh account, sign into it, and then skip the forge-wide window for every account for 24 hours (GOOD_SOURCE_MS). Closes #15028.

What changed: the list of good sources in src/core/signin-window.ts was keyed by source alone. It is now keyed by account and source, the same key (accountKey) the per-account window and the wrong-password window already use. The module comment and the comments on vouch, vouched and MAX_GOOD_SOURCES say this now; MAX_GOOD_SOURCES now caps account-and-source pairs rather than sources.

Owner risk: an owner who signed in today from their own source is still let past a full forge-wide window for their own account. They still meet the window from a source that has never proved their password, which is the same as before. The passkey door is the operator's way in and skips the forge-wide window as it did.

Test: one new test in test/signin-window-bounds.test.ts. A source signs into a fresh account and the owner signs in from their own source. Then the forge-wide window is filled. The fresh account's source is refused for another account and for the owner's, and is still admitted for its own; the owner is admitted for theirs. Without the fix this test fails (9 pass, 1 fail); with it, it passes. No existing test changed: the per-source, per-account and wrong-password windows answer as before.

Checks run: bun scripts/gate.ts --fix (it rewrapped comments, now committed) and bun x tsc --noEmit both pass. scripts/fast.ts named 3,202 test files, over its time budget, so I didn't run that list. Instead I ran the 45 test files about sign-in, passwords, passkeys, sign-up and throttling: 234 pass, 0 fail. The full suite runs in the forge's check on this push.

I didn't touch the keep_plan or estimate tools the issue mentions, because they weren't available in this session.

To try it: bun test test/signin-window-bounds.test.ts test/signin-window-limits.test.ts

🤖 Generated with Claude Code

Closes #15028

commented

A right password now lets a source past a full forge-wide window (signin.per_forge) only for the account it proved. Before this, a source could make a fresh account, sign into it, and then skip the forge-wide window for every account for 24 hours (GOOD_SOURCE_MS). Closes #15028.

What changed: the list of good sources in src/core/signin-window.ts was keyed by source alone. It is now keyed by account and source, the same key (accountKey) the per-account window and the wrong-password window already use. The module comment and the comments on vouch, vouched and MAX_GOOD_SOURCES say this now; MAX_GOOD_SOURCES now caps account-and-source pairs rather than sources.

Owner risk: an owner who signed in today from their own source is still let past a full forge-wide window for their own account. They still meet the window from a source that has never proved their password, which is the same as before. The passkey door is the operator's way in and skips the forge-wide window as it did.

Test: one new test in test/signin-window-bounds.test.ts. A source signs into a fresh account and the owner signs in from their own source. Then the forge-wide window is filled. The fresh account's source is refused for another account and for the owner's, and is still admitted for its own; the owner is admitted for theirs. Without the fix this test fails (9 pass, 1 fail); with it, it passes. No existing test changed: the per-source, per-account and wrong-password windows answer as before.

Checks run: bun scripts/gate.ts --fix (it rewrapped comments, now committed) and bun x tsc --noEmit both pass. scripts/fast.ts named 3,202 test files, over its time budget, so I didn't run that list. Instead I ran the 45 test files about sign-in, passwords, passkeys, sign-up and throttling: 234 pass, 0 fail. The full suite runs in the forge's check on this push.

I didn't touch the keep_plan or estimate tools the issue mentions, because they weren't available in this session.

To try it: bun test test/signin-window-bounds.test.ts test/signin-window-limits.test.ts

🤖 Generated with Claude Code

Approved

Clean, small, single-purpose. The good-source vouch is now keyed by accountKey (account|source bucket), the same key the per-account and wrong-password windows use, so a source vouched for one account meets the forge-wide window like a stranger for any other. Source and account windows are untouched. The new test fails without the fix and checks both the refusal for other accounts and admission for the proved one. Comments updated; no new dependency; no web or terminal surface. Minor note, not blocking: account names are cut to 64 chars in the key, so two accounts sharing a 64-char prefix share a vouch, as they already share the windows.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs