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

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

This PHP script has an unrestricted file uploadingvulnerability.

$_FILES[‘upload_file’][‘name’] returns a filename in the formatof “filename.extension”, where both the filename and extension areunknown. Therefore, $_FILES[‘upload_file’][‘name’] represents asymbolic value. (10 Points)

$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 a unrestricted file uploadingvulnerability if the dst
    OR
    OR

Leave a Comment

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