From 6bb530cef64a54c754bddc4bf1e1c3e6e76823ae Mon Sep 17 00:00:00 2001 From: Nathan Rover Date: Wed, 29 Jul 2026 20:26:49 -0400 Subject: [PATCH 1/3] docs: resolve security scan operator-guidance findings Re-read every 2026-07-28 scan finding against the implicated code. F-01, F-02, F-03, and F-06 were real operator-guidance gaps and are closed without touching runtime source or the public API: - the package README names claimsFor and repairUserByEmail as privileged alongside provisionVerifiedUser, and forbids reaching any of the three from unauthenticated traffic or user-supplied identifiers; - it states that finishAccountCreation authenticates existing accounts, so the creation endpoint needs sign-in-grade policy; - it requires hosts to authenticate the email-change endpoint for the named principal and to demand a fresh passkey assertion before beginEmailChange; - the threat model records the email-change freshness obligation and the deliberate absence of attestation verification as explicit invariants. F-04, F-05, and F-07 are disputed as non-findings with reasoning recorded on each item: a deliverable address cannot be hashed, HMAC-derived codes are PRF outputs over a random per-operation handle, and credential IDs are non-secret by the threat model. Also normalizes the pre-existing Prettier emphasis style in docs/securityscan.md so format:check passes. Co-Authored-By: Claude Fable 5 --- docs/THREAT_MODEL.md | 14 ++++++++++++++ docs/securityscan.md | 26 ++++++++++++++++++++++---- packages/identity/README.md | 24 ++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 4 deletions(-) diff --git a/docs/THREAT_MODEL.md b/docs/THREAT_MODEL.md index 4e142e1..27c8333 100644 --- a/docs/THREAT_MODEL.md +++ b/docs/THREAT_MODEL.md @@ -86,6 +86,11 @@ Security invariants: the reservation; an active generation must cross-check the independently stored passkey mirror's owner, credential identity, generation, public key, transports, label, creation time, and counter. +- Authenticator attestation is deliberately not verified. Registration uses + `attestationType: "none"`, so no authenticator-model or AAGUID policy is + expressed and software passkeys are accepted. This is the correct default + for consumer passkeys; a host that must assume hardware-bound keys cannot + obtain that assurance from this component. - Challenges are unpredictable, hashed at rest, short-lived, single-use, attempt-bounded, and version-conditionally swept through storage-core's authoritative bounded collection scan. The adapter returns at most the @@ -119,6 +124,15 @@ Security invariants: - Email change is a repairable cross-collection saga. Old-address notification is atomically enqueued with completed operation state only after User and new-index agreement. +- Email change carries no freshness requirement inside the component: it + verifies only that the named principal is active and email-verified, and + mailbox control of the new address completes it. Authenticating the + change endpoint for that principal and requiring a fresh passkey assertion + before `beginEmailChange` are host obligations, recorded in the package + README. The old-address notification is a detective control that arrives + only after the change commits, so a host that skips step-up leaves a + hijacked session able to redirect email sign-in and recovery, bounded by + the victim's retained passkeys. - Mail delivery is at least once. Provider idempotency keys fence ambiguous sends; authenticated callbacks are generation-fenced; dead-letter and terminal-unknown outcomes remain operator-visible until acknowledged. diff --git a/docs/securityscan.md b/docs/securityscan.md index 71f72f2..cb21088 100644 --- a/docs/securityscan.md +++ b/docs/securityscan.md @@ -10,7 +10,7 @@ Findings are appended below in the order they were discovered during the scan. --- -*(Scan complete — 7 findings, none Critical/High/Medium. Summary at bottom.)* +_(Scan complete — 7 findings, none Critical/High/Medium. Summary at bottom.)_ ### F-01 — Privileged claim-issuing primitives on the public API surface @@ -19,6 +19,7 @@ Findings are appended below in the order they were discovered during the scan. - **Evidence:** `createIdentity()` exposes `provisionVerifiedUser`, `repairUserByEmail`, and `claimsFor` directly on the frozen public object (`packages/identity/src/index.ts:389-393`). `claimsFor` (`packages/identity/src/users.ts:456-463`) returns `VerifiedIdentityClaims` for **any** principalId that resolves to an active verified user, with no proof of possession. `provisionVerifiedUser` (`packages/identity/src/users.ts:334-382`) creates an already-verified user without any email-code ceremony. - **Exploitability:** Not exploitable inside the component — these exist so the verified email-code repair path and host bootstrap can run. Risk is realized only if a host wires them to an unauthenticated route; then arbitrary verified-account creation / claim minting for any known principalId. - **Recommendation:** Document in the package README that these three methods must never be reachable from unauthenticated traffic; consider a naming or options-level gate in a future API revision. +- ✅ Resolved 2026-07-29 — `packages/identity/README.md` now names `claimsFor` and `repairUserByEmail` as privileged alongside `provisionVerifiedUser` and forbids reaching any of the three from unauthenticated traffic or user-supplied identifiers. ### F-02 — Email change requires no fresh authentication; old address notified only after the fact @@ -27,6 +28,7 @@ Findings are appended below in the order they were discovered during the scan. - **Evidence:** `begin("email_change", ...)` (`packages/identity/src/email-codes.ts:302-322`) requires only that the principal is active + email-verified. Proof of control of the **new** inbox (`finishEmailChange`) completes the change; the old address receives `old-address-notification` only after `effectState: "complete"` (`packages/identity/src/email-codes.ts:604-619`, `803-870`). - **Exploitability:** An attacker holding a hijacked session (sessions are out of component scope) can redirect email-code sign-in and recovery to an inbox they control. Bounded by: passkeys remain bound to the principal (victim retains passkey sign-in and can revert), and the old-address notification is a detective control. - **Recommendation:** Host guidance to require a fresh passkey assertion before `beginEmailChange`; confirm coverage in `docs/THREAT_MODEL.md`. +- ✅ Resolved 2026-07-29 — README now requires hosts to authenticate the change endpoint for the named principal and to demand a fresh passkey assertion before `beginEmailChange`; the freshness gap and its bound are recorded as an invariant in `docs/THREAT_MODEL.md`. No code change: the component owns no session, so freshness is not observable here. ### F-03 — WebAuthn attestation is not verified @@ -34,12 +36,14 @@ Findings are appended below in the order they were discovered during the scan. - **Status:** Accepted design (confirm in threat model) - **Evidence:** `attestationType: "none"` in `beginRegistration` (`packages/identity/src/passkeys.ts:785`). No authenticator-model/AAGUID policy is possible; software passkeys are permitted. - **Exploitability:** N/A for typical consumer passkey deployments; relevant only if a host assumes hardware-bound keys. +- ✅ Resolved 2026-07-29 — the acceptance is now an explicit invariant in `docs/THREAT_MODEL.md`, stating that attestation is not verified, that software passkeys are accepted, and that hosts needing hardware-bound keys cannot get that assurance here. ### F-04 — Plaintext PII (email addresses) at rest - **Severity:** Informational - **Status:** Accepted design - **Evidence:** Email addresses are stored unhashed in `UserRecord.email`, `EmailIndexRecord.email`, `EmailCodeOperationRecord.targetEmail`/`oldEmail` (`packages/identity/src/records.ts:18-54`, `packages/identity/src/email-operation-records.ts:26-56`). Required so the Mail worker can deliver; hashes own lookup/uniqueness. At-rest protection is delegated to the storage layer. +- ⚠️ Disputed 2026-07-29 — not a valid finding: a deliverable address is not a secret and cannot be hashed. `prepareMail` renders to `operation.targetEmail`/`oldEmail` and the Mail job's `recipientRef`, so a recoverable address is a functional requirement of asynchronous delivery, not an oversight. Lookup and uniqueness already run on domain-separated digests, the threat model treats email as attacker-knowable contact data (`docs/THREAT_MODEL.md:60`), and at-rest confidentiality sits with the storage adapter and operator (boundary 4). No defect and no residual action in this component. ### F-05 — Email codes are deterministic HMAC outputs, not random values @@ -47,6 +51,7 @@ Findings are appended below in the order they were discovered during the scan. - **Status:** Accepted design — key-management dependency - **Evidence:** `createHmacEmailCodeProtector` (`packages/identity/src/crypto.ts:80-162`) derives the code as `HMAC(secret, handleHash ‖ block) mod 10^8`. The stored verifier is separately domain-separated (`email-codes.ts:331-343`). Code secrecy rests entirely on the host-owned HMAC secret; compromise of the secret exposes all in-TTL codes. Minimum 32-byte secret enforced (`crypto.ts:83-92`); secret zeroed after key import (`crypto.ts:102`). - **Positive observations (no action):** unbiased rejection sampling (`crypto.ts:104-127`), constant-time verifier compare (`crypto.ts:63-72`, `156-159`), 8-digit space bounded by `maxAttempts ≤ 10` + TTL ≤ 15 min (decoder invariants `email-operation-records.ts:245-247`) + dual rate limiters (`email-codes.ts:480-484`). +- ⚠️ Disputed 2026-07-29 — not a valid finding: "deterministic" describes the derivation, not the guessability. The HMAC input is the digest of a fresh per-operation handle from `newId()` (`crypto.randomUUID()` by default, 122 bits), so each code is a PRF output over a random input and is uniformly distributed and unpredictable to anyone without the key — the same guarantee a CSPRNG code would give. Determinism is required so an asynchronous Mail worker can render a code that was never stored. The key-compromise dependency is inherent to any keyed scheme and is already an explicit invariant (`docs/THREAT_MODEL.md:111-118`) with a documented rotation procedure in the package README. No defect and no residual action. ### F-06 — `finishAccountCreation` silently doubles as email sign-in for existing accounts @@ -55,6 +60,7 @@ Findings are appended below in the order they were discovered during the scan. - **Evidence:** When a code is verified for an email that already belongs to an active principal, `repair()` returns the existing user (`packages/identity/src/email-codes.ts:689-710`) and `finishAccountCreation` issues `VerifiedIdentityClaims` for that principal (`email-codes.ts:758-774`). The account-creation endpoint is therefore also a full sign-in endpoint. - **Exploitability:** None beyond the intended mailbox-control-equals-sign-in model, but a host that treats "signup" as lower-risk than "login" (weaker rate limiting, no session policy, no anomaly detection on the creation route) would under-protect a sign-in path. - **Recommendation:** State explicitly in the package README that the creation flow authenticates existing accounts and must carry the same endpoint policy as sign-in. +- ✅ Resolved 2026-07-29 — README now states that `finishAccountCreation` returns an existing principal's claims and that the creation endpoint must carry the same rate limiting, session policy, and anomaly detection as `finishEmailSignIn`. ### F-07 — Timing side-channel distinguishes registered credential IDs @@ -62,6 +68,7 @@ Findings are appended below in the order they were discovered during the scan. - **Status:** Accepted per threat model (credential IDs are not secrets) - **Evidence:** `finishAuthentication` returns via `verificationFailed(claim)` before `verifyAuthenticationResponse` when the credential ID is unknown (`packages/identity/src/passkeys.ts:936-962`); a registered ID proceeds through signature verification, a measurably more expensive path. - **Exploitability:** An attacker who already possesses a candidate credential ID can confirm its registration remotely. Credential IDs are random, non-enumerable authenticator outputs; the threat model (`docs/THREAT_MODEL.md:60`) explicitly treats them as non-secret. Residual value is negligible. +- ⚠️ Disputed 2026-07-29 — not a valid finding: the oracle only confirms a value the attacker already holds, and it discloses neither a principal nor an account's existence, so it is below the Low bar in this repository's severity calibration. Each probe additionally costs one `beginPasskeyAuthentication` challenge — claimed and released per attempt (`passkeys.ts:952-962`, `745-755`) — under the authentication limiter. Equalizing the path would mean running a synthetic signature verification against a fabricated public key on every unknown credential, adding attacker-triggerable CPU cost and a new failure mode to protect a value the threat model declares non-secret (`docs/THREAT_MODEL.md:60`). Behavior is unchanged deliberately. --- @@ -93,6 +100,17 @@ Findings are appended below in the order they were discovered during the scan. ### Suggested follow-ups (non-blocking) -1. README: one line stating `claimsFor`/`repairUserByEmail` are privileged alongside `provisionVerifiedUser` (F-01). -2. README: one line stating the account-creation flow authenticates existing accounts (F-06). -3. Threat model: one line recording that attestation is not verified (`attestationType: "none"`, F-03) so the acceptance is explicit. +1. README: one line stating `claimsFor`/`repairUserByEmail` are privileged alongside `provisionVerifiedUser` (F-01). — done 2026-07-29. +2. README: one line stating the account-creation flow authenticates existing accounts (F-06). — done 2026-07-29. +3. Threat model: one line recording that attestation is not verified (`attestationType: "none"`, F-03) so the acceptance is explicit. — done 2026-07-29. + +## Disposition review + +**Reviewed:** 2026-07-29 + +Every finding was re-read against the implicated code before disposition. + +- **Resolved:** F-01, F-02, F-03, F-06 — operator-guidance gaps closed in `packages/identity/README.md` and `docs/THREAT_MODEL.md`. All three suggested follow-ups above are complete. +- **Disputed:** F-04, F-05, F-07 — accurate observations that do not describe a weakness in this component; the reasoning is recorded on each item. + +No runtime source changed, so the public API and behavior of `@pegma/identity` are unchanged. The `0.1.1` patch release exists to ship the corrected package README to consumers. diff --git a/packages/identity/README.md b/packages/identity/README.md index a6695e5..cac3acd 100644 --- a/packages/identity/README.md +++ b/packages/identity/README.md @@ -102,6 +102,24 @@ fallback, and recovery do not disclose whether an address exists. Unknown fallback/recovery requests commit durable suppression records with the same request-path transaction shape; they can never become valid later. +The creation flow also authenticates existing accounts. When the verified +address already belongs to an active principal, `finishAccountCreation` +returns that principal's claims instead of failing, because mailbox control +is the same proof either way. Treat the creation endpoint as a sign-in +endpoint: give it the same rate limiting, session policy, and anomaly +detection as `finishEmailSignIn`, never a weaker "signup" policy. + +`beginEmailChange` and `finishEmailChange` are authenticated management +operations. The host must prove the caller owns the named `principalId` +before calling either; the library only checks that the principal is active +and email-verified. Because mailbox control of the _new_ address completes +the change, and the old address is notified only after the change commits, +require a fresh passkey assertion — not merely a live session — immediately +before `beginEmailChange`. Without that step-up, a stolen session can +redirect email sign-in and recovery to an attacker-controlled inbox; the +victim's passkeys stay bound to the principal, so passkey sign-in and a +reverting change remain available. + `emailCodeSecret` must contain at least 32 random bytes loaded from stable, host-managed secret storage on every process restart; never generate it during process startup. Pass a plain `Uint8Array`. Node callers that decode with @@ -168,6 +186,12 @@ const claims = await identity.claimsFor(user.principalId); Do not expose `provisionVerifiedUser` directly as public signup. Normal account creation verifies an email code through `beginAccountCreation` and `finishAccountCreation`. +`claimsFor` and `repairUserByEmail` are privileged in exactly the same sense: +`claimsFor` mints verified claims for any active verified `PrincipalId` +without proof of possession, and `repairUserByEmail` completes a reservation +for any known address. None of these three methods may ever be reachable from +unauthenticated traffic, or from a request whose `principalId` or email is +taken from user input rather than from an already-authenticated context. The reserve/prepare/commit/activate protocol is durable across crashes; `repairUserByEmail` completes an interrupted operation. Concurrent equivalent emails converge on the one principal that won the structural reservation. From 5fed13cdcb345689a06310953eb1c3e1178876c1 Mon Sep 17 00:00:00 2001 From: Nathan Rover Date: Wed, 29 Jul 2026 20:26:57 -0400 Subject: [PATCH 2/3] chore: prepare identity v0.1.1 Documentation-only patch release. The packed dist/ output is unchanged from 0.1.0; the release exists so consumers receive the corrected package README with the host-obligation guidance from the security scan dispositions. Co-Authored-By: Claude Fable 5 --- docs/PROJECT_PLAN.md | 4 +++- docs/RELEASE_NOTES.md | 29 +++++++++++++++++++++++++++++ package-lock.json | 6 +++--- package.json | 2 +- packages/identity/package.json | 2 +- 5 files changed, 37 insertions(+), 6 deletions(-) diff --git a/docs/PROJECT_PLAN.md b/docs/PROJECT_PLAN.md index 17692a3..014d58c 100644 --- a/docs/PROJECT_PLAN.md +++ b/docs/PROJECT_PLAN.md @@ -4,7 +4,9 @@ **Stage:** Phases 1–4 are complete. `@pegma/identity@0.1.0` is published and live in pegma.dev with `@pegma/authorization-identity@0.1.2`. The public API -remains unstable. +remains unstable. `0.1.1` is a documentation-only patch that closes the +operator-guidance findings from the 2026-07-28 security scan; it changes no +runtime behavior and no public API. The audited `0.0.0` name-reservation bootstrap is published and deliberately unadvertised. Version `0.1.0` contains the reviewed full passwordless diff --git a/docs/RELEASE_NOTES.md b/docs/RELEASE_NOTES.md index 660caa6..6bb93cc 100644 --- a/docs/RELEASE_NOTES.md +++ b/docs/RELEASE_NOTES.md @@ -1,5 +1,34 @@ # Release notes +## 0.1.1 + +`0.1.1` closes the operator-guidance findings from the 2026-07-28 repository +security scan. It changes no runtime behavior and no public API; the packed +`dist/` output is identical to `0.1.0`. The release exists so consumers +receive the corrected package README. + +### Security documentation + +- `claimsFor` and `repairUserByEmail` are now named as privileged operations + alongside `provisionVerifiedUser`. None of the three may be reachable from + unauthenticated traffic or from a user-supplied `principalId` or email. +- The account-creation flow is documented as also authenticating existing + accounts: `finishAccountCreation` returns an existing principal's claims, + so the creation endpoint needs sign-in-grade rate limiting, session policy, + and anomaly detection. +- Email change now carries explicit host obligations: authenticate the + endpoint for the named principal, and require a fresh passkey assertion + before `beginEmailChange`. The old-address notification is a detective + control that arrives only after the change commits. +- `docs/THREAT_MODEL.md` records two acceptances explicitly: authenticator + attestation is not verified (`attestationType: "none"`), and email-change + freshness is a host obligation rather than a component invariant. + +Three scan findings were reviewed and disputed as non-findings, with the +reasoning kept in `docs/securityscan.md`: plaintext deliverable addresses at +rest, deterministic HMAC-derived codes, and the credential-ID timing +distinction in `finishPasskeyAuthentication`. + ## 0.1.0 `0.1.0` is the first advertised stable release of `@pegma/identity`. It diff --git a/package-lock.json b/package-lock.json index b929140..bf69c3c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "identity", - "version": "0.1.0", + "version": "0.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "identity", - "version": "0.1.0", + "version": "0.1.1", "license": "MIT", "workspaces": [ "packages/*" @@ -6056,7 +6056,7 @@ }, "packages/identity": { "name": "@pegma/identity", - "version": "0.1.0", + "version": "0.1.1", "license": "MIT", "dependencies": { "@pegma/mail": "0.1.0", diff --git a/package.json b/package.json index 2319e10..8e0391a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "identity", - "version": "0.1.0", + "version": "0.1.1", "private": true, "description": "Passkeys-first, passwordless first-party identity for Pegma hosts.", "license": "MIT", diff --git a/packages/identity/package.json b/packages/identity/package.json index 87feb09..451f001 100644 --- a/packages/identity/package.json +++ b/packages/identity/package.json @@ -1,6 +1,6 @@ { "name": "@pegma/identity", - "version": "0.1.0", + "version": "0.1.1", "description": "Passkeys-first, passwordless first-party identity for Pegma hosts.", "license": "MIT", "type": "module", From 9a015c9458c97446892663ce9b72bf9fcb34b568 Mon Sep 17 00:00:00 2001 From: Nathan Rover Date: Wed, 29 Jul 2026 20:31:59 -0400 Subject: [PATCH 3/3] docs: make security scan status fields match their dispositions Copilot review: the F-01 status still cited pre-change README line numbers and a residual gap this PR closes, and F-02 still read "Open" directly above its resolution line. Each status now states the current disposition while keeping the scan-time observation as history; F-03 and F-06 get the same treatment for consistency. Co-Authored-By: Claude Fable 5 --- docs/securityscan.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/securityscan.md b/docs/securityscan.md index cb21088..6c0179b 100644 --- a/docs/securityscan.md +++ b/docs/securityscan.md @@ -15,7 +15,7 @@ _(Scan complete — 7 findings, none Critical/High/Medium. Summary at bottom.)_ ### F-01 — Privileged claim-issuing primitives on the public API surface - **Severity:** Low (hardening / trust-boundary documentation) -- **Status:** Mitigated by documentation — `packages/identity/README.md:153-170` explicitly labels `provisionVerifiedUser` "an explicitly privileged provisioning operation" and warns "Do not expose `provisionVerifiedUser` directly as public signup"; `claimsFor` is shown inside the same privileged block. Residual: the warning covers provisioning but does not separately call out `claimsFor`/`repairUserByEmail`; a one-line addition would close the gap. +- **Status:** Resolved 2026-07-29 — the "Verified provisioning" section of `packages/identity/README.md` now names all three methods. At scan time it labelled `provisionVerifiedUser` "an explicitly privileged provisioning operation" and warned "Do not expose `provisionVerifiedUser` directly as public signup", but did not separately call out `claimsFor`/`repairUserByEmail`; that residual is closed. - **Evidence:** `createIdentity()` exposes `provisionVerifiedUser`, `repairUserByEmail`, and `claimsFor` directly on the frozen public object (`packages/identity/src/index.ts:389-393`). `claimsFor` (`packages/identity/src/users.ts:456-463`) returns `VerifiedIdentityClaims` for **any** principalId that resolves to an active verified user, with no proof of possession. `provisionVerifiedUser` (`packages/identity/src/users.ts:334-382`) creates an already-verified user without any email-code ceremony. - **Exploitability:** Not exploitable inside the component — these exist so the verified email-code repair path and host bootstrap can run. Risk is realized only if a host wires them to an unauthenticated route; then arbitrary verified-account creation / claim minting for any known principalId. - **Recommendation:** Document in the package README that these three methods must never be reachable from unauthenticated traffic; consider a naming or options-level gate in a future API revision. @@ -24,7 +24,7 @@ _(Scan complete — 7 findings, none Critical/High/Medium. Summary at bottom.)_ ### F-02 — Email change requires no fresh authentication; old address notified only after the fact - **Severity:** Low -- **Status:** Open — design tradeoff, partially mitigated +- **Status:** Resolved 2026-07-29 by host guidance — the underlying design tradeoff stands (the component owns no session, so it cannot observe assertion freshness); the obligation now sits explicitly with the host in `packages/identity/README.md` and `docs/THREAT_MODEL.md`. - **Evidence:** `begin("email_change", ...)` (`packages/identity/src/email-codes.ts:302-322`) requires only that the principal is active + email-verified. Proof of control of the **new** inbox (`finishEmailChange`) completes the change; the old address receives `old-address-notification` only after `effectState: "complete"` (`packages/identity/src/email-codes.ts:604-619`, `803-870`). - **Exploitability:** An attacker holding a hijacked session (sessions are out of component scope) can redirect email-code sign-in and recovery to an inbox they control. Bounded by: passkeys remain bound to the principal (victim retains passkey sign-in and can revert), and the old-address notification is a detective control. - **Recommendation:** Host guidance to require a fresh passkey assertion before `beginEmailChange`; confirm coverage in `docs/THREAT_MODEL.md`. @@ -33,7 +33,7 @@ _(Scan complete — 7 findings, none Critical/High/Medium. Summary at bottom.)_ ### F-03 — WebAuthn attestation is not verified - **Severity:** Informational -- **Status:** Accepted design (confirm in threat model) +- **Status:** Accepted design — confirmed in `docs/THREAT_MODEL.md` on 2026-07-29 - **Evidence:** `attestationType: "none"` in `beginRegistration` (`packages/identity/src/passkeys.ts:785`). No authenticator-model/AAGUID policy is possible; software passkeys are permitted. - **Exploitability:** N/A for typical consumer passkey deployments; relevant only if a host assumes hardware-bound keys. - ✅ Resolved 2026-07-29 — the acceptance is now an explicit invariant in `docs/THREAT_MODEL.md`, stating that attestation is not verified, that software passkeys are accepted, and that hosts needing hardware-bound keys cannot get that assurance here. @@ -56,7 +56,7 @@ _(Scan complete — 7 findings, none Critical/High/Medium. Summary at bottom.)_ ### F-06 — `finishAccountCreation` silently doubles as email sign-in for existing accounts - **Severity:** Informational -- **Status:** Accepted design — host-policy dependency +- **Status:** Accepted design — host-policy dependency, documented in `packages/identity/README.md` on 2026-07-29 - **Evidence:** When a code is verified for an email that already belongs to an active principal, `repair()` returns the existing user (`packages/identity/src/email-codes.ts:689-710`) and `finishAccountCreation` issues `VerifiedIdentityClaims` for that principal (`email-codes.ts:758-774`). The account-creation endpoint is therefore also a full sign-in endpoint. - **Exploitability:** None beyond the intended mailbox-control-equals-sign-in model, but a host that treats "signup" as lower-risk than "login" (weaker rate limiting, no session policy, no anomaly detection on the creation route) would under-protect a sign-in path. - **Recommendation:** State explicitly in the package README that the creation flow authenticates existing accounts and must carry the same endpoint policy as sign-in.