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

Commit

Permalink
If a client is posting bad parameters, it can end up copying a file i…
Browse files Browse the repository at this point in the history
…nto itself.
  • Loading branch information
cdujeu committed Mar 12, 2015
1 parent e2987e4 commit fcf6c1f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/src/plugins/access.fs/class.fsAccessDriver.php
Expand Up @@ -1292,6 +1292,9 @@ protected function copyUploadedData($uploadData, $destination, $filename, $messa
protected function appendUploadedData($folder, $source, $target){

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

0 comments on commit fcf6c1f

Please sign in to comment.