bug: two members with the same username share ONE Nextcloud account: user_oidc keys on preferred_username, which nothing makes unique (IDIP) #1902
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Reference
Matou/idss#1902
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Symptom (whakatohea-demo, 2026-09-25)
Two different members signed in to Files (Nextcloud) through the IDIP bridge and landed in the same Nextcloud account, with the same files:
preferred_usernameEI5am6…(operator)benEExc8Y…(#1887)benEDzI7…ben)occ user:listhas one OIDC user,ben. Each sign-in overwrites that account's details with whoever signed in last. Nextcloud's log shows the email flipping betweenben@matou.nzandben@tairea.ioat 20:56Z and 21:01Z (the "email changed" notices it tried to send), and group provisioning rewrites the groups from the last sign-in'socgroups.Cause
user_oidcnames each account after thepreferred_usernameclaim (--unique-uid=0 --mapping-uid=preferred_username,internal/clan/files.go:1084-1085co-host and:1172-1173device/IDIP). On the IDIP pathpreferred_usernamecomes from the member's credential (identityFromVerdict,internal/idp/ledger_verifier.go:135; words door:keri_verifier.go:138from the roster), and nothing makes it unique. The member picks it when joining, so two members can hold the same one.Security impact: a joiner who chooses the steward's username gets the steward's Nextcloud account: their files and their shares. Group provisioning rewrites the groups on each sign-in, so admin is not inherited while the member is signed in, but everything the account owns is.
Probably related (not verified live): on IDIP the control plane keys people by AID (
identityFromSub,internal/controlapi/oidcprovider.go:56). If the files suspend port (internal/nextcloud/nextcloud.go:~250-267) addresses/cloud/users/<AID>, it finds "no account here" and never disables the username-keyed Nextcloud user. The gate's forward_auth still refuses a suspended member, so this is defence in depth, not an open door.Other services also key on
preferred_username: Gramps (whakapapa.go:645), video (video.go:660), newsletters, surveys, Paperless and portroute. Any fix that only touches Nextcloud leaves them exposed to the same collision.Options (Ben to rule, including existing accounts)
A. Key Nextcloud on the AID (
--mapping-uid=sub) on the IDIP path. Each person gets exactly one account, named by their AID. That also matches the control plane's person id, so suspend can reach it. Nextcloud cannot rename users, so existing username-keyed accounts need one of:occ files:transfer-ownership <old> <aid>) or deletes it.files:transfer-ownership(files and shares), then disables the old account. Where a username is held by more than one AID (the collision this bug is about), it cannot know whose files they are. It leaves that account alone and raises a steward alert.Nextcloud-only: the other services stay exposed.
B. The bridge makes
preferred_usernameunique per community. The bridge recordsusername → AIDin the roster projection the first time an AID presents (#1887's presented rows already hold it). A later AID with a taken username gets a free suffix (ben-2). Every service's existing accounts stay exactly where they are, with no migration, and allpreferred_username-keyed services are fixed at once. Costs: first come first served (on IDIP the founder presents first, so the steward keeps the bare name), the claim no longer always equals what the member typed, and communities that already collided (like this demo) stay merged until an admin splits them.Recommendation: B for the platform (it closes the takeover for every service and needs no migration), plus A2 for Nextcloud only if you want Nextcloud accounts to follow the AID for the suspend reason above.
Demo state (hand patch, 2026-09-25 ~21:15Z)
The demo's
user_oidcprovider was switched by hand toprovider-1-mappingUid = sub, so the next sign-in of each person creates an AID-keyed account. The mergedbenaccount (andocadmin) are left as they are. This is overwritten by the next run of thenextcloud-oidconeshot (a rerender or a Files redeploy) until the code fix lands.Acceptance criteria (after the ruling)
preferred_usernamesign in to Files and get two separate Nextcloud accounts. A seam test covers this over the rendered provider config and the bridge claims.preferred_username(or the ruled option's equivalent).References
sub= AID), ADR 0235 d.5/d.6, DDR 0173 story 4 (only files-admin writesadmin), #866 (whypreferred_usernamewas chosen on kanidm)🤖 Generated with Claude Code
Ruled (Ben, 2026-09-25): option A1.
user_oidcprovider keys accounts on the AID:--mapping-uid=sub(with--unique-uid=0, so the uid is the bare AID). Do this wherever the provider is rendered for an IDIP IdP (internal/clan/files.go, the co-host block and the device/bridge block). kanidm communities are unchanged: they keeppreferred_username, which kanidm already makes unique (#866).occ files:transfer-ownership <old> <aid>) or deletes it.internal/nextcloudaddresses/cloud/users/<AID>on IDIP and pin it with a test.preferred_username-keyed services (Gramps, video, newsletters, surveys, Paperless, portroute). Their exposure is a separate ticket.Acceptance criteria, as ruled:
--mapping-uid=sub, and kanidm's render still usespreferred_username. A render test pins both.preferred_usernameget two separate Nextcloud accounts, keyed by their AIDs.The demo already runs
provider-1-mappingUid = subby hand. Landing this makes that survive the next render.swarm-claim host=elitebook-distributed-server-03 run=33016
(automated multi-host claim — lowest live claim id works this ticket)
close-report for #1902 — status
success✅ close-report gates passed — every claim verified against main; issue closed.
envelope