Directory group named like an app-managed space grants access to it #919

Closed
opened 2026-10-15 20:59:35 +00:00 by Cordy · 4 comments
Owner

Found during the #911 research and the fix-911 build (v0.6.345).

What happens: an IdP or LDAP group with the same name as an app-managed (Cairn-created) space grants access to that space through the group path in the membership rule. The -ro variant grants read. v0.6.345 closed the same hole for app-owned groups (#690), and for deactivated and deleted spaces, but not for directory groups that merely share the name.

Decide (research first):

  • Refuse at creation: refuse creating an app space whose name matches an existing directory group, and the reverse where we can see it.
  • Origin wins: only the space's own membership source grants access. App spaces use store roles only; IdP spaces use groups only.
  • Document it: leave the behaviour as it is and explain it in the docs.

Check: how power mode and live group resolution interact with each option.

Found during the #911 research and the fix-911 build (v0.6.345). **What happens:** an IdP or LDAP group with the same name as an app-managed (Cairn-created) space grants access to that space through the group path in the membership rule. The `-ro` variant grants read. v0.6.345 closed the same hole for app-owned groups (#690), and for deactivated and deleted spaces, but not for directory groups that merely share the name. **Decide (research first):** - **Refuse at creation:** refuse creating an app space whose name matches an existing directory group, and the reverse where we can see it. - **Origin wins:** only the space's own membership source grants access. App spaces use store roles only; IdP spaces use groups only. - **Document it:** leave the behaviour as it is and explain it in the docs. **Check:** how power mode and live group resolution interact with each option.
Author
Owner

Concrete attack, from the fix-923 docs review (2026-10-16): pre-claiming a directory group's space.

fix-923 refuses to create a space over a directory space Cairn already knows, that is, one whose folder exists or that has a registry record. A directory group Cairn has not seen yet is not detected (spacetaken.go:124-131). So:

  1. Anyone can create an app space with that group's name before its folder exists.
  2. When the group later appears in the identity provider, groupsGrant (membership.go:170-180) gives the group's members write access to the app-owned space.
  3. The creator owns that space and sees everything the group's members put there.

This is the same root cause as this issue: group names grant access to app spaces of the same name. The research for this issue should include the "Origin wins" option (app spaces get store roles only), which closes this attack. Until then, the handbook (fix-923) tells operators to create a new group's folder before announcing the group.

**Concrete attack, from the fix-923 docs review (2026-10-16):** pre-claiming a directory group's space. fix-923 refuses to create a space over a directory space Cairn already knows, that is, one whose folder exists or that has a registry record. A directory group Cairn has not seen yet is not detected (`spacetaken.go:124-131`). So: 1. Anyone can create an app space with that group's name before its folder exists. 2. When the group later appears in the identity provider, `groupsGrant` (`membership.go:170-180`) gives the group's members write access to the app-owned space. 3. The creator owns that space and sees everything the group's members put there. This is the same root cause as this issue: group names grant access to app spaces of the same name. The research for this issue should include the "Origin wins" option (app spaces get store roles only), which closes this attack. Until then, the handbook (fix-923) tells operators to create a new group's folder before announcing the group.
Author
Owner

#1002 research (2026-10-26) confirms and extends this issue: research-1002-1-cairn.md §1.4 and §3.7, research-1002-2-market.md.

  • Still true on v0.6.354:
    • An IdP group named like an active app-owned space gets write on it (test sketch in §3.7).
    • The pre-claim path: nameTaken cannot see an IdP group that has neither folder nor record (spacetaken.go:120-127). VERIFIED.
  • New: under Keycloak key custody, that unrelated group also becomes the holder of the app space's encryption key. See #967 and #1002.
  • New: an app group named like an LDAP group cuts the LDAP group out of its space (membership.go:131).
  • Precedent: Argo CD warns that SSO group names can take local users' roles. Kubernetes prefixes group names by issuer.
  • Recommended: "origin wins". App spaces grant only through Cairn's own store, directory spaces only through their directory group (by id where available). This is stage 2 of the #1002 plan.

The decision is asked together with #1002.

#1002 research (2026-10-26) confirms and extends this issue: `research-1002-1-cairn.md` §1.4 and §3.7, `research-1002-2-market.md`. - **Still true on v0.6.354:** - An IdP group named like an active app-owned space gets write on it (test sketch in §3.7). - The pre-claim path: `nameTaken` cannot see an IdP group that has neither folder nor record (spacetaken.go:120-127). VERIFIED. - **New:** under Keycloak key custody, that unrelated group also becomes the **holder of the app space's encryption key**. See #967 and #1002. - **New:** an app group named like an LDAP group cuts the LDAP group out of its space (membership.go:131). - **Precedent:** Argo CD warns that SSO group names can take local users' roles. Kubernetes prefixes group names by issuer. - **Recommended:** "origin wins". App spaces grant only through Cairn's own store, directory spaces only through their directory group (by id where available). This is stage 2 of the #1002 plan. The decision is asked together with #1002.
Author
Owner

Decision (Nikola, 2026-10-26): origin wins. App-owned spaces grant only through Cairn's own groups, and directory spaces only through their bound directory group. This is built in the #1002 stage 2+3 batch; see the decisions on #1002.

**Decision (Nikola, 2026-10-26): origin wins.** App-owned spaces grant only through Cairn's own groups, and directory spaces only through their bound directory group. This is built in the #1002 stage 2+3 batch; see the decisions on #1002.
Author
Owner

Released in v0.6.357 (PR #1015), live on both dogfoods.

  • Origin wins: app spaces grant only through Cairn's groups, and directory spaces only through their bound directory group.
  • On files-bao: the upgrade logged origin wins: app space test no longer grants to directory group /test (1 members).
  • Same name as an app group: a directory space named like an app group goes to Needs review (D-H) instead of being granted.

Closing.

Released in **v0.6.357** (PR #1015), live on both dogfoods. - **Origin wins:** app spaces grant only through Cairn's groups, and directory spaces only through their bound directory group. - **On files-bao:** the upgrade logged `origin wins: app space test no longer grants to directory group /test (1 members)`. - **Same name as an app group:** a directory space named like an app group goes to Needs review (D-H) instead of being granted. Closing.
Cordy closed this issue 2026-10-26 18:03:19 +00:00
Sign in to join this conversation.
No labels
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Cordy/Cairn#919
No description provided.