External Variable Modification: Overwriting Critical Variables
If extract() is used in a script that relies on specific variables, an attacker can manipulate them.
<?php
$authenticated = false;
extract($_GET);
if ($authenticated) {
echo "Access granted!";
} else {
echo "Access denied!";
}
?>Exploitation:
In this example, the use of extract($_GET) allow an attacker to set the $authenticated variable to true:
http://example.com/vuln.php?authenticated=true
http://example.com/vuln.php?authenticated=1
Comments
No comments yet.