From 90c3529301e1528b91346a1493a079deb6cb80e7 Mon Sep 17 00:00:00 2001 From: JieXu Date: Thu, 2 Oct 2025 00:37:31 +0800 Subject: [PATCH] [Security] Replace timestamp-based password generation with random generator (#3571) * Update x-ui.sh * Update x-ui.sh * Update x-ui.sh * Update x-ui.sh --- x-ui.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-ui.sh b/x-ui.sh index 643534a1..cadc71a1 100644 --- a/x-ui.sh +++ b/x-ui.sh @@ -189,9 +189,9 @@ reset_user() { fi read -rp "Please set the login username [default is a random username]: " config_account - [[ -z $config_account ]] && config_account=$(date +%s%N | md5sum | cut -c 1-8) + [[ -z $config_account ]] && config_account=$(gen_random_string 10) read -rp "Please set the login password [default is a random password]: " config_password - [[ -z $config_password ]] && config_password=$(date +%s%N | md5sum | cut -c 1-8) + [[ -z $config_password ]] && config_password=$(gen_random_string 18) read -rp "Do you want to disable currently configured two-factor authentication? (y/n): " twoFactorConfirm if [[ $twoFactorConfirm != "y" && $twoFactorConfirm != "Y" ]]; then