aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files
diff options
context:
space:
mode:
authorCarl Schwan <carl@carlschwan.eu>2021-10-21 16:57:07 +0200
committerCarl Schwan <carl@carlschwan.eu>2021-10-21 17:11:52 +0200
commit9408f8ae6994666b685f5e2de588f9b2a79a00ed (patch)
tree10ab0ee16994d20e21931a2774cfe38d1a12f752 /lib/private/Files
parentc5405befcfeb5dcc0d8cce85d5ea8466fed3c268 (diff)
downloadnextcloud-server-9408f8ae6994666b685f5e2de588f9b2a79a00ed.tar.gz
nextcloud-server-9408f8ae6994666b685f5e2de588f9b2a79a00ed.zip
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 https://github.com/nextcloud/groupfolders/issues/1692 Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'lib/private/Files')
-rw-r--r--lib/private/Files/Storage/Local.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/private/Files/Storage/Local.php b/lib/private/Files/Storage/Local.php
index 870217db20f..13f1a6f2ec4 100644
--- a/lib/private/Files/Storage/Local.php
+++ b/lib/private/Files/Storage/Local.php
@@ -525,7 +525,10 @@ class Local extends \OC\Files\Storage\Common {
* @return bool
*/
public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $targetInternalPath, $preserveMtime = false) {
- if ($sourceStorage->instanceOfStorage(Local::class)) {
+ // Don't treat ACLStorageWrapper like local storage where copy can be done directly.
+ // Instead use the slower recursive copying in php from Common::copyFromStorage with
+ // more permissions checks.
+ if ($sourceStorage->instanceOfStorage(Local::class) && !$sourceStorage->instanceOfStorage('OCA\GroupFolders\ACL\ACLStorageWrapper')) {
if ($sourceStorage->instanceOfStorage(Jail::class)) {
/**
* @var \OC\Files\Storage\Wrapper\Jail $sourceStorage