Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(acls): allow uploading files with read+create+delete permissions#4500

Merged
provokateurin merged 1 commit into
masterfrom
leftybournes/fix/acls
Mar 11, 2026
Merged

fix(acls): allow uploading files with read+create+delete permissions#4500
provokateurin merged 1 commit into
masterfrom
leftybournes/fix/acls

Conversation

@leftybournes
Copy link
Copy Markdown
Member

This fixes an issue with accounts unable to upload files or folders without the edit permission. The logic was essentially copied from server's permission mask wrapper.

@leftybournes leftybournes added 3. to review Items that need to be reviewed bug labels Mar 11, 2026
@provokateurin provokateurin merged commit 975afff into master Mar 11, 2026
54 checks passed
@provokateurin provokateurin deleted the leftybournes/fix/acls branch March 11, 2026 08:48
@leftybournes
Copy link
Copy Markdown
Member Author

/backport to stable33

@leftybournes
Copy link
Copy Markdown
Member Author

/backport to stable32

@brlin-tw
Copy link
Copy Markdown
Contributor

@leftybournes

Hello, I'm also tackling the same issue and encountered this pull request as a result.

I would like to ask whether it would be more proper to verify whether the file's xxh128 hash match as well from the security perspective?

Something like:

--- a/apps/groupfolders/lib/ACL/ACLStorageWrapper.php
+++ b/apps/groupfolders/lib/ACL/ACLStorageWrapper.php
@@ -70,13 +70,15 @@
 	}
 
 	public function rename(string $source, string $target): bool {
-		if (str_starts_with($source, $target)) {
-			$part = substr($source, strlen($target));
-			//This is a rename of the transfer file to the original file
-			if (str_starts_with($part, '.ocTransferId')) {
+		//This is a rename of the transfer file to the original file
+		if (dirname($source) === dirname($target) && ($ocTransferIdPos = strpos(basename($source), '.ocTransferId')) > 0) {
+			$sourceHash = substr(basename($source), 0, $ocTransferIdPos);
+			$expectedHash = hash('xxh128', basename($target));
+			if ($sourceHash === $expectedHash) {
 				return $this->checkPermissions($target, Constants::PERMISSION_CREATE) && parent::rename($source, $target);
 			}
 		}
+
 		$permissions = $this->file_exists($target) ? Constants::PERMISSION_UPDATE : Constants::PERMISSION_CREATE;
 		$sourceParent = dirname($source);
 		if ($sourceParent === '.') {

Thanks for the fix, BTW.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Items that need to be reviewed bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants