Write Symbolic Constraint Signature Following Vulnerable Php Code Express Symbolic Constra Q37128291

write the symbolic constraint signature for the followingvulnerable PHP code. You can express the symbolic constraintsignature using Z3 syntax.

This PHP script has an unrestrictedfile uploading vulnerability.

$_FILES[‘upload_file’][‘name’] returnsa filename in the format of “filename.extension”, where both thefilename and extension are unknown. Therefore,$_FILES[‘upload_file’][‘name’] represents a symbolic value. (10Points)

$path = “./temp”;

$filename =$_FILES[‘upload_file’][‘name’];

$pathAndName = $path . “/” .$filename;

if(strlen($filename) > 5){

move_uploaded_file($_FILES[‘upload_file’][‘name’],$pathAndName);

}

  1. $_FILES[‘upload_file’][‘name’] returns a filename in the formatof “filename.extension”, where both the filename and extension areunknown. But both of them are non-empty strings.
  2. move_uploaded_file(src, dst) moves a file from src to dst. Thisfunction is going to create
    OR
    OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.