Security: one membership rule for trash, change feed and peering; Collabora refused saves (#911, #913 server; v0.6.345) #917

Merged
Cordy merged 22 commits from fix-911 into main 2026-10-15 20:58:22 +00:00
Owner

Fixes #911. Covers the server part of #913; the editor-page part comes later with a mockup.

Spec: docs/superpowers/specs/2026-10-15-fix-911-design.md. Plan: docs/superpowers/plans/2026-10-15-fix-911.md. Every task went through TDD and a task review, then a whole-branch review and a docs accuracy review.

Security

  • Group-name over-grant: an app-owned group with the same name as an app space let its members see, restore and permanently delete that space's Deleted files. The change feed leaked that space's changed paths the same way, and peering send allowed sending from it.
  • Custom read-only suffix: the trash ignored it.
  • Deactivated or deleted spaces: their names still granted access to directory groups of the same name.
  • Peering send path check: a .. in the path bypassed the write check, so a person could send files from a space they can only read. The OCM space-path check had the same bypass.
  • Peering send hold check: it ran on the virtual path, so held files could be sent.
  • Old space name: retiring the old name of a renamed space while it was still the space's folder let a group of that name reach the space.
  • Legal holds and retention after a rename: they did not protect Deleted files entries recorded under the space's old folder.

All of these now resolve through one membership rule exported by scope. The trash, the change feed and peering use it, and the trash's own group logic is gone.

Fixes

  • Space Deleted files (#911):
    • App-managed and renamed spaces: members of these now see the space's Deleted files.
    • Rights: readers see entries; writers restore any entry and permanently delete only their own deletions (trash-not-yours); the owner and admins can do everything.
    • IDs and paths: entry IDs carry the space ID, and entries show the current space name and the person's own paths.
    • Restore: always lands inside the space's current folder.
  • Collabora (#913):
    • Refused saves: Collabora 26.04 treated every refused save as a storage conflict. It reloaded the document, or asked "changed in storage". After a refusal, the session's next CheckFileInfo now reports the refused upload's size once, while the file is unchanged, so the editor treats it as a plain failed save. This applies to version-not-saved, locked and quota refusals.
    • Locks: a locked save answers 423 instead of 409 + 1010.
    • Concurrent writes: a real external change still gives a conflict, and the file's state is captured before the write, so a write made during the refusal cannot be overwritten.

Tests

  • Rig tests on posix and s3, with and without encryption.
  • A fake Collabora contract test that models COOL 26.04's size rule, as shipped and as fixed.
  • The fault probe from the research now passes.

Upgrade notes

See CHANGELOG v0.6.345.

Live checks

To run after merge, on both dogfoods:

  • the group-name probe;
  • the #913 re-run on files.

Results go on the issues.

Fixes #911. Covers the server part of #913; the editor-page part comes later with a mockup. Spec: `docs/superpowers/specs/2026-10-15-fix-911-design.md`. Plan: `docs/superpowers/plans/2026-10-15-fix-911.md`. Every task went through TDD and a task review, then a whole-branch review and a docs accuracy review. ## Security - **Group-name over-grant:** an app-owned group with the same name as an app space let its members see, restore and permanently delete that space's Deleted files. The change feed leaked that space's changed paths the same way, and peering send allowed sending from it. - **Custom read-only suffix:** the trash ignored it. - **Deactivated or deleted spaces:** their names still granted access to directory groups of the same name. - **Peering send path check:** a `..` in the path bypassed the write check, so a person could send files from a space they can only read. The OCM space-path check had the same bypass. - **Peering send hold check:** it ran on the virtual path, so held files could be sent. - **Old space name:** retiring the old name of a renamed space while it was still the space's folder let a group of that name reach the space. - **Legal holds and retention after a rename:** they did not protect Deleted files entries recorded under the space's old folder. All of these now resolve through one membership rule exported by scope. The trash, the change feed and peering use it, and the trash's own group logic is gone. ## Fixes - **Space Deleted files (#911):** - **App-managed and renamed spaces:** members of these now see the space's Deleted files. - **Rights:** readers see entries; writers restore any entry and permanently delete only their own deletions (`trash-not-yours`); the owner and admins can do everything. - **IDs and paths:** entry IDs carry the space ID, and entries show the current space name and the person's own paths. - **Restore:** always lands inside the space's current folder. - **Collabora (#913):** - **Refused saves:** Collabora 26.04 treated every refused save as a storage conflict. It reloaded the document, or asked "changed in storage". After a refusal, the session's next CheckFileInfo now reports the refused upload's size once, while the file is unchanged, so the editor treats it as a plain failed save. This applies to version-not-saved, locked and quota refusals. - **Locks:** a locked save answers 423 instead of 409 + 1010. - **Concurrent writes:** a real external change still gives a conflict, and the file's state is captured before the write, so a write made during the refusal cannot be overwritten. ## Tests - Rig tests on posix and s3, with and without encryption. - A fake Collabora contract test that models COOL 26.04's size rule, as shipped and as fixed. - The fault probe from the research now passes. ## Upgrade notes See CHANGELOG v0.6.345. ## Live checks To run after merge, on both dogfoods: - the group-name probe; - the #913 re-run on files. Results go on the issues.
C1: peering send cleaned once (storage.CleanPath) in the API, in
Sender.Start before the hold, write and Stat checks, and in peerWritable,
so '..', '//' and NFD cannot make a check judge another space. OCM
share-send cleans too, so its space refusal sees the reached path.
I2: a restore refused for an invalid recorded path (R14) logs one line
and answers 400 trash-entry-invalid. M1: the change feed asks membership
once per folder per request. M4: a typed-nil Membership fails closed.
M5: API-level one-log-line assertions. I1: no literal long dash in the
web test.
Cordy merged commit f1fa550025 into main 2026-10-15 20:58:22 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
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#917
No description provided.