Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit fcf6c1f

Browse files
committed
If a client is posting bad parameters, it can end up copying a file into itself.
1 parent e2987e4 commit fcf6c1f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

core/src/plugins/access.fs/class.fsAccessDriver.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,6 +1292,9 @@ protected function copyUploadedData($uploadData, $destination, $filename, $messa
12921292
protected function appendUploadedData($folder, $source, $target){
12931293

12941294
$already_existed = false;
1295+
if($source == $target){
1296+
throw new Exception("Something nasty happened: trying to copy $source into itself, it will create a loop!");
1297+
}
12951298
if (file_exists($folder ."/" . $target)) {
12961299
$already_existed = true;
12971300
$this->logDebug("Should copy stream from $source to $target");

0 commit comments

Comments
 (0)