Skip to content

Require parent permissions to delete or move a resource - #916

Merged
aduffeck merged 1 commit into
opencloud-eu:mainfrom
aduffeck:fix/share-root-delete-move
Oct 26, 2026
Merged

aduffeck merged 1 commit into
opencloud-eu:mainfrom
aduffeck:fix/share-root-delete-move

Conversation

@aduffeck

Copy link
Copy Markdown
Member

A recipient could delete or move the root of a share they received, which deletes or moves the owner's resource. Decomposedfs only checked Delete or Move on the node itself, and the share grant sits on exactly that node.

#897 blocked this in the gateway, but only for references that address the share root by id alone. A relative path reaches the same node and skips that check, for example:

  • DELETE /dav/spaces//
  • MOVE of one received share into another received share from the same space

This PR moves the rule into decomposedfs. Deleting or moving a resource now also requires Delete or Move on its parent:

  • Owners and space members are unaffected, since their permissions come from the space root.
  • Inside a share, the parent is covered by the share grant, so only the share root itself loses Delete and Move.
  • It applies to posix, decomposed and decomposeds3.

The gateway check from #897 is reverted. The storage check now covers it, and the gateway check cost a ListReceivedShares call on every delete by id.

Unit tests cover deleting and moving a share root, which is denied, and resources below it, which is allowed.

Follow-up to #897, refs opencloud-eu/opencloud#3770

A grant on the resource itself, like a share, no longer allows taking it
out of its parent. Reverts the gateway check from opencloud-eu#897.
@aduffeck
aduffeck requested review from butonic and maki5 October 26, 2026 13:36
@aduffeck
aduffeck merged commit ed84949 into opencloud-eu:main Oct 26, 2026
20 checks passed
@aduffeck
aduffeck deleted the fix/share-root-delete-move branch October 26, 2026 14:13
@openclouders openclouders mentioned this pull request Oct 26, 2026
1 task
v-scharf added a commit that referenced this pull request Oct 26, 2026
A DELETE of /Shares/<name> reaches the sharesstorageprovider relative to the
share jail root, e.g. './<name>'. Only a reference by share id with the path
'.' rejected the share, so this one was forwarded to the owner's storage and
deleted the shared resource itself. Since #916 that is denied with 403.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants