Skip to content

Commit

Permalink
Make user enumeration harder.
Browse files Browse the repository at this point in the history
  • Loading branch information
kohler committed Sep 5, 2024
1 parent c145497 commit 4259850
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ function check_sessioninfo(data, options) {
$(document).ajaxError(function (evt, jqxhr, options, httperror) {
if (jqxhr.readyState != 4)
return;
var data;
let data;
if (jqxhr.responseText && jqxhr.responseText.charAt(0) === "{") {
try {
data = JSON.parse(jqxhr.responseText);
Expand Down
5 changes: 4 additions & 1 deletion src/api/api_user.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ static function user(Contact $user, Qrequest $qreq, ?PaperInfo $prow) {
if (($email = trim($qreq->email ?? "")) === "") {
return JsonResult::make_missing_error("email");
}
if (!is_valid_utf8($email)) {
if (!is_valid_utf8($email)
|| ($at = strpos($email, "@")) === false
|| $at === 0
|| ($dot = strpos($email, ".", $at + 1)) === false) {
return JsonResult::make_parameter_error("email");
}

Expand Down

0 comments on commit 4259850

Please sign in to comment.