Skip to content
Permalink
Browse files Browse the repository at this point in the history
update #Arbitrary file upload vulnerability
  • Loading branch information
abcprintf committed Dec 19, 2019
1 parent c644d0d commit 71436ba
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions upload.php
Expand Up @@ -9,25 +9,29 @@
$ready = true;
}else{
echo "was not an image<br>";
exit();
}

if($_FILES["fileUpload"]["size"] < 1000000){
$ready = true;
echo "file size is ".$_FILES['fileUpload']["size"]."<br>";
}else{
echo "file was TOO BIG!";
exit();
}

if($_FILES["fileUpload"]["error"]){
echo "looks like there was an error".$_FILES['fileUpload']["error"]."<br>";
$ready = false;
exit();
}

$targetPath = "images/".$imageFile;
$sourcePath = $_FILES["fileUpload"]["tmp_name"];
if(file_exists("images/".$imageFile)){
echo "File already there <br>";
$ready = false;
exit();
}

if($ready == true){
Expand Down

0 comments on commit 71436ba

Please sign in to comment.