I know that some people may just answer "never" until user input. But suppose I have something like this:
$version = $_REQUEST['version'];
$test = 'return $version > 3;';
$success = eval($test);
This is obviously a simplified case, but is there anything that the user can enter how versionto make it do something malicious? If I limit the type of lines that I $testcan take to compare the value of some variables with other variables, is there any way that anyone can see to use this?
Edit
I tried running the script on the server and nothing happens:
<?php
$version = "exec('mkdir test') + 4";
$teststr = '$version > 3;';
$result = eval('return ' . $teststr);
var_dump($result);
?>
, , bool(false). . , exec('mkdir test') , . , , , , , .