Skip to content

Commit

Permalink
bug: cookie is not set if the host address is localhost:4320
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikhail Fedosov committed May 11, 2024
1 parent 0773216 commit aee770c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion vulnerabilities/weak_id/source/high.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
}
$_SESSION['last_session_id_high']++;
$cookie_value = md5($_SESSION['last_session_id_high']);
setcookie("dvwaSession", $cookie_value, time()+3600, "/vulnerabilities/weak_id/", $_SERVER['HTTP_HOST'], false, false);
setcookie("dvwaSession", $cookie_value, time()+3600, "/vulnerabilities/weak_id/", $_SERVER['SERVER_NAME'], false, false);
}

?>
2 changes: 1 addition & 1 deletion vulnerabilities/weak_id/source/impossible.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

if ($_SERVER['REQUEST_METHOD'] == "POST") {
$cookie_value = sha1(mt_rand() . time() . "Impossible");
setcookie("dvwaSession", $cookie_value, time()+3600, "/vulnerabilities/weak_id/", $_SERVER['HTTP_HOST'], true, true);
setcookie("dvwaSession", $cookie_value, time()+3600, "/vulnerabilities/weak_id/", $_SERVER['SERVER_NAME'], true, true);
}
?>

0 comments on commit aee770c

Please sign in to comment.