Browse Source

restrict webauthn-tfa-get-args sql query

FreddleSpl0it 3 years ago
parent
commit
4ec982163e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      data/web/json_api.php

+ 1 - 1
data/web/json_api.php

@@ -452,7 +452,7 @@ if (isset($_GET['query'])) {
           }
           }
         break;
         break;
         case "webauthn-tfa-get-args":
         case "webauthn-tfa-get-args":
-          $stmt = $pdo->prepare("SELECT `keyHandle` FROM `tfa` WHERE username = :username");
+          $stmt = $pdo->prepare("SELECT `keyHandle` FROM `tfa` WHERE username = :username AND authmech = `webauthn`");
           $stmt->execute(array(':username' => $_SESSION['pending_mailcow_cc_username']));
           $stmt->execute(array(':username' => $_SESSION['pending_mailcow_cc_username']));
           $rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
           $rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
           if (count($rows) == 0) {
           if (count($rows) == 0) {