From 46938f77c715e47ef269205d219f729c81e3dd6b Mon Sep 17 00:00:00 2001 From: infosave2007 Date: Fri, 30 Jan 2026 15:38:18 +0300 Subject: [PATCH] fix: Prevent X-ray client UUID reuse --- inc/VpnClient.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/inc/VpnClient.php b/inc/VpnClient.php index 1e3614e..9af85d6 100644 --- a/inc/VpnClient.php +++ b/inc/VpnClient.php @@ -268,14 +268,15 @@ class VpnClient if (is_array($decoded)) { $inbounds = $decoded['inbounds'] ?? []; if (is_array($inbounds) && !empty($inbounds)) { - $settings = $inbounds[0]['settings'] ?? []; - $clients = $settings['clients'] ?? []; - if (is_array($clients) && !empty($clients)) { - $cid = $clients[0]['id'] ?? null; - if (is_string($cid) && $cid !== '' && empty($vars['client_id'])) { - $vars['client_id'] = $cid; - } - } + // Block removed: Do not reuse existing client ID for new clients + // $settings = $inbounds[0]['settings'] ?? []; + // $clients = $settings['clients'] ?? []; + // if (is_array($clients) && !empty($clients)) { + // $cid = $clients[0]['id'] ?? null; + // if (is_string($cid) && $cid !== '' && empty($vars['client_id'])) { + // $vars['client_id'] = $cid; + // } + // } $stream = $inbounds[0]['streamSettings'] ?? []; if (is_array($stream) && ($stream['security'] ?? '') === 'reality') { $rs = $stream['realitySettings'] ?? [];