diff --git a/insecure.php b/insecure.php index e69de29..a3a1ed3 100644 --- a/insecure.php +++ b/insecure.php @@ -0,0 +1,27 @@ +$var\n"; + + +// +/// 2nd XSS example +// +$var = $_POST['varB']; +echo "
$varB
\n"; + +// +/// Forget to terminate user input after a redirect +// +if ($_SESSION['user_logged_in'] !== true) { + header('Location: /login.php'); +} + +// Important private logic that shouldn't happen because we've already redirected the user!