OIDC: a sign-in with an unverified email pre-creates an account a later verified sign-in links to #90
Loading…
Reference in a new issue
No description provided.
Delete branch "fix-83-oidc-unverified"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What changed
An unverified OIDC sign-in can no longer make an account a later sign-in joins, and the owner's email-link confirm now removes its identities, API keys and every outbound setting (backups, Vikunja, LanguageTool, OCR provider, reMarkable pairing); F2, F4, F5, F6, F7 are fixed and precommit passes (C30).
Red, then green
bash -o pipefail -c 'eval "$(mise activate bash --shims)"; MIX_ENV=test mix test test/rm_analyzer/accounts_test.exs test/rm_analyzer_web/controllers/oidc_controller_test.exs 2>&1 | tail -3'60213ac): exit 16a8536a): exit 0export PATH=$HOME/.local/bin:$PATH && eval "$(mise activate bash --shims)" && MIX_ENV=test mix test test/rm_analyzer/accounts_test.exs60213ac): exit 1c6a850f): exit 0Checks
bash -o pipefail -c 'eval "$(mise activate bash --shims)"; mix precommit 2>&1 | tail -3', exit 0bash -o pipefail -c 'eval "$(mise activate bash --shims)"; MIX_ENV=test mix test test/rm_analyzer/accounts_test.exs test/rm_analyzer_web/controllers/oidc_controller_test.exs 2>&1 | tail -3', exit 051140ed. (Upper Wolfjaw):bash -o pipefail -c 'export PATH=$HOME/.local/bin:$PATH; eval "$(mise activate bash --shims)"; mix precommit 2>&1 | tail -3', exit 098fec93(F5 fix). (Upper Wolfjaw):bash -o pipefail -c 'export PATH=$HOME/.local/bin:$PATH; eval "$(mise activate bash --shims)"; mix precommit 2>&1 | tail -3', exit 0set -e; for p in probe83 probe83b; do /home/peak/work/rm-analyzer-1-6-1/probes/$p.sh .; done; /home/peak/work/rm-analyzer-1-6-1/run-tests.sh . test/rm_analyzer/accounts_test.exs test/rm_analyzer_web/controllers/oidc_controller_test.exs, exit 0d16b7ae(F7 fix), including two new OIDC controller tests: another email from a signed-in browser gets its own account, and a stale session can't link. (Upper Wolfjaw):bash -c 'export PATH=$HOME/.local/bin:$PATH; eval "$(mise activate bash --shims)"; mix precommit 2>&1 | tail -3', exit 0d16b7ae(review/83e) the F2, F4 and both F7 probes (mine and Upper Wolfjaw's) pass along with the accounts and all controller tests, 104 tests: a signed-in browser now links a provider account only for the user's own email within 10 minutes of sign-in. (Nye):cd /home/peak/work/rm-analyzer-1-6-1 && W=rm-analyzer && git -C $W rev-parse --short HEAD && cp probes/nye_probe83_test.exs probes/nye_probe83b_test.exs $W/test/rm_analyzer/ && cp probes/nye_probe83d_test.exs $W/test/rm_analyzer_web/ && ./run-tests.sh $W test/rm_analyzer/nye_probe83_test.exs test/rm_analyzer/nye_probe83b_test.exs test/rm_analyzer_web/nye_probe83d_test.exs test/rm_analyzer/accounts_test.exs test/rm_analyzer_web/controllers/; rc=$?; rm -f $W/test/rm_analyzer/nye_probe83_test.exs $W/test/rm_analyzer/nye_probe83b_test.exs $W/test/rm_analyzer_web/nye_probe83d_test.exs; exit $rc, exit 0c6a850f: compile with warnings as errors, unused deps, format, full suite. (Upper Wolfjaw):export PATH=$HOME/.local/bin:$PATH && eval "$(mise activate bash --shims)" && mix precommit 2>&1 | tail -3, exit 0c6a850fI read the diff and ran the full suite (1374 pass) in my own worktree. I looked for other outbound tables, other confirm paths, a re-pair that keeps an old row, and a strict email_verified check; I found no gap. Untested: users made before the fix, real browser flow, and concurrent sign-ins. (Prover):bash -c 'export PATH=$HOME/.local/bin:$PATH; eval "$(mise activate bash --shims)"; MIX_ENV=test mix test test/rm_analyzer/accounts_test.exs test/rm_analyzer_web/controllers/oidc_controller_test.exs 2>&1 | tail -3', exit 0Found and fixed
92b892e), an MCP API key the unverified OIDC sign-in made while the account was its own survives the owner's email-link confirm, so the attacker's key still reaches the owner's notes after the identity is unlinked. (fixed)98fec93) any provider sign-in from a signed-in browser joins the signed-in account whatever its email, so a different person's verified account (or anyone holding a session briefly) gets a permanent SSO login to the owner's account with no recent-auth check; on main that sign-in gets its own account. (fixed)Risks
A legit user whose IdP omits email_verified loses those outbound settings and their reMarkable pairing at their first email-link sign-in and has to set them up again (accepted in D14). Adopted pre-user OCR/pairing rows are kept by timestamp (second precision). Other non-outbound data the unverified sign-in made (chats, drafts) stays.
Prover
Passed (Sonnet): At
c6a850fI read the diff and ran the full suite (1374 pass) in my own worktree. I looked for other outbound tables, other confirm paths, a re-pair that keeps an old row, and a strict email_verified check; I found no gap. Untested: users made before the fix, real browser flow, and concurrent sign-ins.Every command above was run by Fortysix's Basecamp itself, on the branch named.