[GH-ISSUE #4040] [Bug] Reality subscription uses empty shortId when first shortIds element is empty string #2739

Closed
opened 2026-10-31 20:27:35 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @juner922 on GitHub (Apr 19, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4040

Describe the bug

When creating a VLESS Reality inbound, the default shortIds array contains an empty string as the first element: ["", "0123456789abcdef"].

The subscription link generator (genVlessLink in subService.go) picks the first shortId from the array, resulting in sid= (empty) in the generated vless:// link.

While an empty shortId is technically valid in Xray-core (it means no shortId verification), many popular clients like Mihomo/Clash.Meta fail to establish connections with an empty sid parameter.

How to reproduce

  1. Create a VLESS Reality inbound with default shortIds (which includes empty string as first element)
  2. Access the subscription link
  3. The generated vless:// link will have sid= (empty)
  4. Import this link into Mihomo/Clash Verge - connection fails

Expected behavior

The subscription generator should either:

  • Skip empty shortIds and use the first non-empty one
  • Or not include empty string in the default shortIds array

3x-ui Version

2.8.11

Xray-core Version

v25.12.8

Originally created by @juner922 on GitHub (Apr 19, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/4040 ### Describe the bug When creating a VLESS Reality inbound, the default shortIds array contains an empty string as the first element: ["", "0123456789abcdef"]. The subscription link generator (genVlessLink in subService.go) picks the first shortId from the array, resulting in sid= (empty) in the generated vless:// link. While an empty shortId is technically valid in Xray-core (it means no shortId verification), many popular clients like Mihomo/Clash.Meta fail to establish connections with an empty sid parameter. ### How to reproduce 1. Create a VLESS Reality inbound with default shortIds (which includes empty string as first element) 2. Access the subscription link 3. The generated vless:// link will have sid= (empty) 4. Import this link into Mihomo/Clash Verge - connection fails ### Expected behavior The subscription generator should either: - Skip empty shortIds and use the first non-empty one - Or not include empty string in the default shortIds array ### 3x-ui Version 2.8.11 ### Xray-core Version v25.12.8
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#2739
No description provided.