A grantee's lock blocks the owner on her own file, and outlives the share #978

Closed
opened 2026-10-20 04:43:48 +00:00 by Cordy · 2 comments
Owner

Found in the batch 4 review of #915/#972 (review-b finding 9, 2026-10-19). This needs a product decision.

What happens: since v0.6.351, locks compare the person who acted. A lock bob takes through /shared on anna's file is now bob's, so it blocks anna's own writes. Only bob or an admin can remove it, and the lock survives when anna revokes the share. Before, this was hidden because the identity swap made every lock look like anna's.

Decision needed, after research (how Nextcloud, OneDrive and SharePoint let an owner break a collaborator's lock, and what broke there):

  • the owner may break any lock on her own files;
  • revoking a share releases that grantee's locks;
  • both.
Found in the batch 4 review of #915/#972 (review-b finding 9, 2026-10-19). This needs a product decision. **What happens:** since v0.6.351, locks compare the person who acted. A lock bob takes through `/shared` on anna's file is now bob's, so it blocks anna's own writes. Only bob or an admin can remove it, and the lock survives when anna revokes the share. Before, this was hidden because the identity swap made every lock look like anna's. **Decision needed, after research (how Nextcloud, OneDrive and SharePoint let an owner break a collaborator's lock, and what broke there):** - the owner may break any lock on her own files; - revoking a share releases that grantee's locks; - both.
Author
Owner

Research and decision (2026-10-28): see the C2 decision sheet.

Background:

  • Nextcloud files_lock lets the owner override a lock and drops a user's locks when the share is removed.
  • RFC 4918 §6.4 names the resource owner as someone who may break a lock.
  • Nextcloud's gap here became CVE-2026-77165.

Decision (Nikola):

  • The owner may break any lock on her own files, audited as break-lock, with a bell item to the holder. Space owners already can.
  • A lock stops counting as soon as its holder can no longer write the file, for any reason: share revoked or lowered, removed from the group, account departed. This is checked when a write is attempted, and the lock is also cleared on revoke.
  • WebDAV UNLOCK stays holder-only, and lock expiry stays as it is.

Side finding, filed separately: WOPI file ids depend on the caller's path, so an owner and a grantee probably cannot co-edit one document.

**Research and decision (2026-10-28):** see the C2 decision sheet. **Background:** - Nextcloud files_lock lets the owner override a lock and drops a user's locks when the share is removed. - RFC 4918 §6.4 names the resource owner as someone who may break a lock. - Nextcloud's gap here became CVE-2026-77165. **Decision (Nikola):** - The owner may break any lock on her own files, audited as `break-lock`, with a bell item to the holder. Space owners already can. - A lock stops counting as soon as its holder can no longer write the file, for any reason: share revoked or lowered, removed from the group, account departed. This is checked when a write is attempted, and the lock is also cleared on revoke. - WebDAV UNLOCK stays holder-only, and lock expiry stays as it is. **Side finding, filed separately:** WOPI file ids depend on the caller's path, so an owner and a grantee probably cannot co-edit one document.
Author
Owner

Shipped in v0.6.366 (PR #1032), both dogfoods bumped.

  • The owner of a home may break any lock on her files, including under shares she granted (existing "Break lock" action, now with a confirm naming the holder). Audit break-lock with holder=; the holder gets the bell item lock-broken on every break by someone else (not mutable).
  • A lock stops counting once its holder can no longer write the file: share revoked or lowered, group lost, account departed, disabled, deleted or re-created, new IdP subject. Checked at every write and lock decision; cleared at once on revoke, lower, admin revoke and local account delete. Each release writes the system audit line lock-released.
  • Listings, the Shared list and PROPFIND hide such locks unless deciding would need a directory lookup. Under OIDC without the admin client, a lock whose right may come from a group is kept until the owner breaks it.
  • Device/app credentials need write to break someone else's lock. WebDAV UNLOCK stays holder-only; expiry unchanged.

Side finding (WOPI file ids per caller path, so owner and grantee may not co-edit) is in the backlog. Live check moved to #1005.

Shipped in v0.6.366 (PR #1032), both dogfoods bumped. - The owner of a home may break any lock on her files, including under shares she granted (existing "Break lock" action, now with a confirm naming the holder). Audit `break-lock` with `holder=`; the holder gets the bell item `lock-broken` on every break by someone else (not mutable). - A lock stops counting once its holder can no longer write the file: share revoked or lowered, group lost, account departed, disabled, deleted or re-created, new IdP subject. Checked at every write and lock decision; cleared at once on revoke, lower, admin revoke and local account delete. Each release writes the system audit line `lock-released`. - Listings, the Shared list and PROPFIND hide such locks unless deciding would need a directory lookup. Under OIDC without the admin client, a lock whose right may come from a group is kept until the owner breaks it. - Device/app credentials need write to break someone else's lock. WebDAV UNLOCK stays holder-only; expiry unchanged. Side finding (WOPI file ids per caller path, so owner and grantee may not co-edit) is in the backlog. Live check moved to #1005.
Cordy closed this issue 2026-10-28 01:59:56 +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#978
No description provided.