Skip to content

Commit 945ba32

Browse files
committed
fix: salt parameter splicing
1 parent 83b56b2 commit 945ba32

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

includes/plugin.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -851,6 +851,10 @@ public function generate_challenge(string|null $hmac_key = null, string|int|null
851851
$salt = $salt . "?" . http_build_query(array_merge(array(
852852
"expires" => time() + $expires
853853
), $params));
854+
// Add a delimiter to prevent parameter splicing
855+
if (!str_ends_with($salt, "&")) {
856+
$salt .= "&";
857+
}
854858
$range = $this->get_complexity($complexity);
855859
$secret_number = random_int($range["min"], $range["max"]);
856860
$challenge = hash("sha256", $salt . $secret_number);

0 commit comments

Comments
 (0)