Here's a really simple example:
$val = "";
if(array_key_exists("param", $_REQUEST)) {
$val = $_REQUEST["param"];
}
print "echo \"$val\"";
passthru("echo \"$val\"");
I'm expecting the passthru()
to print A
if I pass test.php?param=\x41
. However, it doesn't look like PHP is interpreting the escape sequence and passing "\x41" to passthru
. I know that the \xAA
shorthand only works on double quoted strings in PHP, but that condition should be satisfied in the example above. Does reading a variable out of $_REQUEST
modify anything?