Skip to content

Commit b5f5883

Browse files
committed
Fix security issues when copying groupfolder with advanced ACL
Using advanced ACL, it is possible that an user has access to a directory but not to a subdirectory, so the copying use Common::copyFromStorage instead of Local::copyFromStorage. Fix nextcloud/groupfolders#1692 Signed-off-by: Carl Schwan <[email protected]>
1 parent c5405be commit b5f5883

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/private/Files/Storage/Local.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,9 @@ private function calculateEtag(string $path, array $stat): string {
525525
* @return bool
526526
*/
527527
public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false) {
528-
if ($sourceStorage->instanceOfStorage(Local::class)) {
528+
// Don't treat ACLStorageWrapper like local storage there copy can be done directly.
529+
// Instead use slowler recursive copying in php with more permissions checks.
530+
if ($sourceStorage->instanceOfStorage(Local::class) && !$sourceStorage->instanceOfStorage('OCA\GroupFolders\ACL\ACLStorageWrapper')) {
529531
if ($sourceStorage->instanceOfStorage(Jail::class)) {
530532
/**
531533
* @var \OC\Files\Storage\Wrapper\Jail $sourceStorage

0 commit comments

Comments
 (0)