Skip to content

Commit 56b11a0

Browse files
authored
Merge pull request #752 from IdkWhatAmIDoin/fix/impossible-weak-id
fix(weak-id): replace predictable mt_rand with cryptographically secure random_bytes
2 parents e8fd506 + dda6b12 commit 56b11a0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

vulnerabilities/weak_id/source/impossible.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
$html = "";
44

55
if ($_SERVER['REQUEST_METHOD'] == "POST") {
6-
$cookie_value = sha1(mt_rand() . time() . "Impossible");
6+
$cookie_value = bin2hex(random_bytes(20));
77
setcookie("dvwaSession", $cookie_value, time()+3600, "/vulnerabilities/weak_id/", $_SERVER['HTTP_HOST'], true, true);
88
}
99
?>

0 commit comments

Comments
 (0)