Skip to content

Commit ac4125a

Browse files
eliashaeusslerohader
authored andcommitted
[SECURITY] Deny destructive write actions on mount folders
Non-privileged users must not be able to perform destructive write actions on folders which represent an active file mount. These actions include move, delete and rename of the related folder, and will be denied by the associate resource storage by a dedicated check in `checkFolderActionPermissions()`. This hardening affects only non-privileged users; privileged users (admins) are still able to perform any destructive actions on file mounts. Resolves: #108910 Releases: main, 14.3, 13.4 Change-Id: I2dc2db1f145beb319b5ad04cc3df7d88578d6fd5 Security-Bulletin: TYPO3-CORE-SA-2026-007 Security-References: CVE-2026-47343 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/94396 Tested-by: Oliver Hader <oliver.hader@typo3.org> Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
1 parent c99e06e commit ac4125a

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

typo3/sysext/core/Classes/Resource/ResourceStorage.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,18 @@ public function getFileMounts()
615615
return $this->fileMounts;
616616
}
617617

618+
public function isFileMountFolder(Folder $folder): bool
619+
{
620+
foreach ($this->fileMounts as $mount) {
621+
$rootLevelFolder = $mount['folder'] ?? null;
622+
if ($rootLevelFolder instanceof Folder && $rootLevelFolder->getCombinedIdentifier() === $folder->getCombinedIdentifier()) {
623+
return true;
624+
}
625+
}
626+
627+
return false;
628+
}
629+
618630
/**
619631
* Checks if the given subject is within one of the registered user
620632
* file mounts. If not, working with the file is not permitted for the user.
@@ -830,9 +842,27 @@ public function checkFolderActionPermission($action, ?Folder $folder = null)
830842
if ($isWriteCheck && !$folderPermissions['w']) {
831843
return false;
832844
}
845+
846+
// Check 5: File mount check
847+
if (!$this->isAllowedActionOnMountFolder($action, $folder)) {
848+
return false;
849+
}
850+
833851
return true;
834852
}
835853

854+
protected function isAllowedActionOnMountFolder(string $action, FolderInterface $folder): bool
855+
{
856+
$deniedMountActions = ['move', 'delete', 'rename'];
857+
858+
// Early return if the given folder is not a mount folder
859+
if (!$folder instanceof Folder || !$this->isFileMountFolder($folder)) {
860+
return true;
861+
}
862+
863+
return !in_array($action, $deniedMountActions, true);
864+
}
865+
836866
/**
837867
* If the fileName is given, checks it against the
838868
* TYPO3_CONF_VARS[BE][fileDenyPattern] + and if the file extension is allowed.

0 commit comments

Comments
 (0)