From 7d8a6606420e904785d76785f1b2f2299fcb31ba Mon Sep 17 00:00:00 2001 From: thisgun Date: Wed, 15 Apr 2026 08:21:59 +0000 Subject: [PATCH] =?UTF-8?q?[security]KVE-2026-0693=20=EB=B9=84=EB=B0=80?= =?UTF-8?q?=EB=B2=88=ED=98=B8=20=EC=9E=AC=EC=84=A4=EC=A0=95=20=ED=86=A0?= =?UTF-8?q?=ED=81=B0=20=EC=98=88=EC=B8=A1=20=EA=B0=80=EB=8A=A5=20=EC=B7=A8?= =?UTF-8?q?=EC=95=BD=EC=A0=90=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rand() 대신 CSPRNG 기반 get_random_token_string() 사용 - mb_nonce: 128비트 CSPRNG 토큰으로 시드 브루트포스 차단 - change_password: CSPRNG 기반 10자리 hex로 변경 Co-Authored-By: Claude Opus 4.6 (1M context) --- bbs/password_lost2.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bbs/password_lost2.php b/bbs/password_lost2.php index 213f55a3b..04b629a2c 100644 --- a/bbs/password_lost2.php +++ b/bbs/password_lost2.php @@ -36,12 +36,12 @@ if (empty($mb['mb_id']) || $mb['mb_leave_date'] || is_admin($mb['mb_id'])) { alert_close($generic_message); } -// 임시비밀번호 발급 -$change_password = rand(100000, 999999); +// 임시비밀번호 발급 (CSPRNG 사용) +$change_password = get_random_token_string(5); // 10자리 hex (0-9, a-f) $mb_lost_certify = get_encrypt_string($change_password); -// 어떠한 회원정보도 포함되지 않은 일회용 난수를 생성하여 인증에 사용 -$mb_nonce = md5(pack('V*', rand(), rand(), rand(), rand())); +// 어떠한 회원정보도 포함되지 않은 일회용 난수를 생성하여 인증에 사용 (CSPRNG 사용) +$mb_nonce = get_random_token_string(16); // 임시비밀번호와 난수를 mb_lost_certify 필드에 저장 $sql = " update {$g5['member_table']} set mb_lost_certify = '$mb_nonce $mb_lost_certify' where mb_id = '{$mb['mb_id']}' ";