restrict webauthn-tfa-get-args sql query
This commit is contained in:
		@@ -452,8 +452,11 @@ 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 AND authmech = `webauthn`");
 | 
					          $stmt = $pdo->prepare("SELECT `keyHandle` FROM `tfa` WHERE username = :username AND authmech = :authmech");
 | 
				
			||||||
          $stmt->execute(array(':username' => $_SESSION['pending_mailcow_cc_username']));
 | 
					          $stmt->execute(array(
 | 
				
			||||||
 | 
					            ':username' => $_SESSION['pending_mailcow_cc_username'],
 | 
				
			||||||
 | 
					            ':authmech' => 'webauthn'
 | 
				
			||||||
 | 
					          ));
 | 
				
			||||||
          $rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
 | 
					          $rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
 | 
				
			||||||
          if (count($rows) == 0) {
 | 
					          if (count($rows) == 0) {
 | 
				
			||||||
            print(json_encode(array(
 | 
					            print(json_encode(array(
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user