[GH-ISSUE #6038] [Bug]: Migration issue: VLESS REALITY with testseed works in v3.4.2 but crashes Xray-core upon upgrading to v3.5.0 #4183

Closed
opened 2026-10-31 20:37:48 +07:00 by bsakaguchi · 3 comments
Owner

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

Describe the bug

Hello. I want to report a migration issue when upgrading from version 3.4.2 to 3.5.0. I have a VLESS inbound using XTLS-Reality along with Vision testseed values, which worked perfectly in v3.4.2. However, right after upgrading to v3.5.0, Xray-core crashes completely and connections drop to zero. I read the changelog and understand that Xray-core v26.7.11 now intentionally rejects the Final Mask and REALITY combination. The problem is that the 3x-ui panel upgrade process does not handle this transition gracefully, leaving existing functional configurations broken and the core unable to start. I suggest adding a database migration step that automatically clears the testseed field for Reality inbounds when upgrading to 3.5.0, so the core can boot successfully without requiring manual database or UI fixes. Thank you.

How to reproduce the problem

In version 3.4.2, create a VLESS inbound with REALITY and xtls-rprx-vision.

Add values to the "Vision testseed" fields.

Upgrade the panel to version 3.5.0 using Docker.

Observe that Xray-core fails to start.

Expected behavior

The panel database migration should detect the REALITY + testseed combination and automatically clear the testseed values so Xray-core can boot successfully in the new version.

Actual behavior

The database retains the legacy testseed values. Xray-core v26.7.11 rejects the configuration and crashes entirely.

Relevant logs


Screenshots

No response

3x-ui version

3.5.0

Xray-core version

26.7.11

How did you install 3x-ui?

install.sh script

Operating system

Ubuntu Linux

Which parts of the panel are affected?

No response

Browser (only if it is a UI bug)

No response

Is the panel behind a reverse proxy or CDN?

None

Before submitting

  • I searched existing issues and this bug has not been reported.
  • I am running the latest released version of 3x-ui (or have verified the bug still exists on it).
  • This bug report is written in English.
  • I have redacted any sensitive data (tokens, real domains, client UUIDs).
Originally created by @diegogarciarojo on GitHub (Jul 19, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6038 ### Describe the bug Hello. I want to report a migration issue when upgrading from version 3.4.2 to 3.5.0. I have a VLESS inbound using XTLS-Reality along with Vision testseed values, which worked perfectly in v3.4.2. However, right after upgrading to v3.5.0, Xray-core crashes completely and connections drop to zero. I read the changelog and understand that Xray-core v26.7.11 now intentionally rejects the Final Mask and REALITY combination. The problem is that the 3x-ui panel upgrade process does not handle this transition gracefully, leaving existing functional configurations broken and the core unable to start. I suggest adding a database migration step that automatically clears the testseed field for Reality inbounds when upgrading to 3.5.0, so the core can boot successfully without requiring manual database or UI fixes. Thank you. ### How to reproduce the problem In version 3.4.2, create a VLESS inbound with REALITY and xtls-rprx-vision. Add values to the "Vision testseed" fields. Upgrade the panel to version 3.5.0 using Docker. Observe that Xray-core fails to start. ### Expected behavior The panel database migration should detect the REALITY + testseed combination and automatically clear the testseed values so Xray-core can boot successfully in the new version. ### Actual behavior The database retains the legacy testseed values. Xray-core v26.7.11 rejects the configuration and crashes entirely. ### Relevant logs ```shell ``` ### Screenshots _No response_ ### 3x-ui version 3.5.0 ### Xray-core version 26.7.11 ### How did you install 3x-ui? install.sh script ### Operating system Ubuntu Linux ### Which parts of the panel are affected? _No response_ ### Browser (only if it is a UI bug) _No response_ ### Is the panel behind a reverse proxy or CDN? None ### Before submitting - [x] I searched [existing issues](../issues?q=is%3Aissue) and this bug has not been reported. - [x] I am running the latest released version of 3x-ui (or have verified the bug still exists on it). - [x] This bug report is written in English. - [x] I have redacted any sensitive data (tokens, real domains, client UUIDs).
bsakaguchi 2026-10-31 20:37:48 +07:00
Author
Owner

@github-actions[bot] commented on GitHub (Jul 19, 2026):

Investigated this against both the 3x-ui and Xray-core source. Two things need correcting in the report, then what's needed to fully confirm it.

"Final Mask" and "Vision testseed" are different, unrelated fields. The v3.5.0 changelog line you're citing ("the bundled core was bumped to xray-core v26.7.11, and the Final Mask + REALITY combination is now rejected") is about streamSettings.finalmask (3x-ui's late-stage transport obfuscation), not settings.testseed (a VLESS Vision-flow padding parameter, only used when a client's flow is exactly xtls-rprx-vision — confirmed in internal/xray/api.go:491-503 and the field's own tooltip in frontend/src/pages/inbounds/form/protocols/vless.tsx:68, "Applies only to clients using the xtls-rprx-vision flow"). The upstream crash behind that changelog line is XTLS/Xray-core#6453: an unchecked type assertion in reality.Server() panics when a finalmask-wrapped connection reaches REALITY's handshake. 3x-ui v3.5.0 already handles that combination automatically, no migration needed:

  • internal/web/service/inbound.go (validateFinalMaskRealityCombo) rejects saving finalmask + reality going forward, wired into AddInbound/UpdateInbound.
  • internal/web/service/xray.go:272-282 (XrayService.GetXrayConfig) strips finalmask from the emitted config whenever security is reality, on every config build — so a row saved before this guard existed self-heals on the next Xray-core start, no dedicated DB migration required (see TestGetXrayConfig_HealsFinalMaskRealityCombo in internal/web/service/inbound_finalmask_reality_test.go).

If your inbound doesn't carry finalmask, that fix isn't what's relevant here. But a separate, real testseed crash mechanism does exist:

Title: Vision testseed has no value validation and can panic the entire Xray-core process, independent of REALITY
Severity: High
Category: Reliability
Why this matters: proxy.XtlsPadding in Xray-core (proxy/proxy.go) computes paddingLen = rand(testseed[1]) + testseed[2] - contentLen and only clamps the upper bound (if paddingLen > buf.Size-21-contentLen). If testseed[2] (panel default 900) is set lower than testseed[0] (panel default 900), paddingLen can go negative for a range of contentLen, and the following buf.Buffer.Extend(paddingLen) panics with "slice bounds out of range" — confirmed by reading common/buf/buffer.go at the v26.7.11 tag (end := b.end + n; ext := b.v[b.end:end], invalid when n is negative). That's an unrecovered panic in a per-connection goroutine, which in Go takes down the whole process, not just that connection — consistent with "connections drop to zero." This isn't hypothetical: XTLS/Xray-core#5961 reproduced the identical panic (slice bounds out of range [230:N], full process crash, all inbounds down) on the same stack — 3x-ui + VLESS + REALITY + xtls-rprx-vision. An Xray-core core team member (co-author of the original testseed PR, #5270) closed that issue advising against setting testseed at all, because some panels submit "illegal" value combinations that trigger it. testseed/testpre were added 2025-12-01 explicitly as temporary, incomplete fields pending an official replacement, consistent with the lack of guardrails. 3x-ui doesn't validate the values anywhere: the Zod schema (frontend/src/schemas/protocols/inbound/vless.ts:42) only requires 4 positive integers, the form (vless.tsx:78) only enforces min={1} per field independently, and neither the hot-apply path (buildUserAccount in internal/xray/api.go) nor config generation (XrayService.GetXrayConfig) clamp or reject unsafe combinations — unlike finalmask+REALITY above, there is currently no save-time guard or self-heal for testseed.
Recommendation: Validate/clamp testseed at save time (e.g. reject or clamp combinations where testseed[2] < testseed[0], mirroring validateFinalMaskRealityCombo), and/or heal existing rows in GetXrayConfig the way finalmask is healed. Given upstream's "don't set it" stance and its stated temporary status, dropping the field entirely is also worth considering. This is a call for @MHSanaei.

Confidence: medium. The mechanism above is well-evidenced (two upstream Xray-core issues, a maintainer statement, and source read across both repos), but I can't confirm it's your exact crash without your data — the issue has no attached log. To close the loop:

  1. The Xray-core panic/crash log from around the failure (Panel → Logs, or docker logs <container>) — a slice bounds out of range trace inside XtlsPadding would confirm this mechanism specifically.
  2. The four testseed values on the affected inbound (panel default is 900, 500, 900, 256; only non-default values are implicated).
  3. The Xray-core version actually running now — Dashboard's "Xray Updates" card, or the x-ui management menu. 3.5.0 bundles v26.7.11 (DockerInit.sh), and that same Dashboard card lets you pin back to an older Xray-core release as an immediate workaround while this is sorted out.

For context: 3x-ui's existing testseed cleanup (internal/web/service/inbound_migration.go:148-154, internal/web/service/client_inbound_apply.go:705-720) only drops it when no client on the inbound uses xtls-rprx-vision. Since Vision is actively in use in your setup, that logic intentionally leaves testseed in place — it was never meant to cover this case, which is why the migration you're asking for doesn't exist yet.

@MHSanaei

This reply was generated automatically; a maintainer may follow up.

<!-- gh-comment-id:5013673793 --> @github-actions[bot] commented on GitHub (Jul 19, 2026): Investigated this against both the 3x-ui and Xray-core source. Two things need correcting in the report, then what's needed to fully confirm it. **"Final Mask" and "Vision testseed" are different, unrelated fields.** The v3.5.0 changelog line you're citing ("the bundled core was bumped to xray-core v26.7.11, and the Final Mask + REALITY combination is now rejected") is about `streamSettings.finalmask` (3x-ui's late-stage transport obfuscation), not `settings.testseed` (a VLESS Vision-flow padding parameter, only used when a client's `flow` is exactly `xtls-rprx-vision` — confirmed in `internal/xray/api.go:491-503` and the field's own tooltip in `frontend/src/pages/inbounds/form/protocols/vless.tsx:68`, "Applies only to clients using the xtls-rprx-vision flow"). The upstream crash behind that changelog line is `XTLS/Xray-core#6453`: an unchecked type assertion in `reality.Server()` panics when a `finalmask`-wrapped connection reaches REALITY's handshake. 3x-ui v3.5.0 already handles that combination automatically, no migration needed: - `internal/web/service/inbound.go` (`validateFinalMaskRealityCombo`) rejects saving `finalmask` + `reality` going forward, wired into `AddInbound`/`UpdateInbound`. - `internal/web/service/xray.go:272-282` (`XrayService.GetXrayConfig`) strips `finalmask` from the emitted config whenever `security` is `reality`, on every config build — so a row saved before this guard existed self-heals on the next Xray-core start, no dedicated DB migration required (see `TestGetXrayConfig_HealsFinalMaskRealityCombo` in `internal/web/service/inbound_finalmask_reality_test.go`). If your inbound doesn't carry `finalmask`, that fix isn't what's relevant here. But a separate, real `testseed` crash mechanism does exist: Title: Vision `testseed` has no value validation and can panic the entire Xray-core process, independent of REALITY Severity: High Category: Reliability Why this matters: `proxy.XtlsPadding` in Xray-core (`proxy/proxy.go`) computes `paddingLen = rand(testseed[1]) + testseed[2] - contentLen` and only clamps the *upper* bound (`if paddingLen > buf.Size-21-contentLen`). If `testseed[2]` (panel default `900`) is set lower than `testseed[0]` (panel default `900`), `paddingLen` can go negative for a range of `contentLen`, and the following `buf.Buffer.Extend(paddingLen)` panics with "slice bounds out of range" — confirmed by reading `common/buf/buffer.go` at the `v26.7.11` tag (`end := b.end + n; ext := b.v[b.end:end]`, invalid when `n` is negative). That's an unrecovered panic in a per-connection goroutine, which in Go takes down the whole process, not just that connection — consistent with "connections drop to zero." This isn't hypothetical: `XTLS/Xray-core#5961` reproduced the identical panic (`slice bounds out of range [230:N]`, full process crash, all inbounds down) on the same stack — 3x-ui + VLESS + REALITY + `xtls-rprx-vision`. An Xray-core core team member (co-author of the original `testseed` PR, `#5270`) closed that issue advising against setting `testseed` at all, because some panels submit "illegal" value combinations that trigger it. `testseed`/`testpre` were added 2025-12-01 explicitly as temporary, incomplete fields pending an official replacement, consistent with the lack of guardrails. 3x-ui doesn't validate the values anywhere: the Zod schema (`frontend/src/schemas/protocols/inbound/vless.ts:42`) only requires 4 positive integers, the form (`vless.tsx:78`) only enforces `min={1}` per field independently, and neither the hot-apply path (`buildUserAccount` in `internal/xray/api.go`) nor config generation (`XrayService.GetXrayConfig`) clamp or reject unsafe combinations — unlike `finalmask`+REALITY above, there is currently no save-time guard or self-heal for `testseed`. Recommendation: Validate/clamp `testseed` at save time (e.g. reject or clamp combinations where `testseed[2] < testseed[0]`, mirroring `validateFinalMaskRealityCombo`), and/or heal existing rows in `GetXrayConfig` the way `finalmask` is healed. Given upstream's "don't set it" stance and its stated temporary status, dropping the field entirely is also worth considering. This is a call for @MHSanaei. Confidence: medium. The mechanism above is well-evidenced (two upstream Xray-core issues, a maintainer statement, and source read across both repos), but I can't confirm it's *your* exact crash without your data — the issue has no attached log. To close the loop: 1. The Xray-core panic/crash log from around the failure (Panel → Logs, or `docker logs <container>`) — a `slice bounds out of range` trace inside `XtlsPadding` would confirm this mechanism specifically. 2. The four `testseed` values on the affected inbound (panel default is `900, 500, 900, 256`; only non-default values are implicated). 3. The Xray-core version actually running now — Dashboard's "Xray Updates" card, or the `x-ui` management menu. `3.5.0` bundles `v26.7.11` (`DockerInit.sh`), and that same Dashboard card lets you pin back to an older Xray-core release as an immediate workaround while this is sorted out. For context: 3x-ui's existing `testseed` cleanup (`internal/web/service/inbound_migration.go:148-154`, `internal/web/service/client_inbound_apply.go:705-720`) only drops it when *no* client on the inbound uses `xtls-rprx-vision`. Since Vision is actively in use in your setup, that logic intentionally leaves `testseed` in place — it was never meant to cover this case, which is why the migration you're asking for doesn't exist yet. @MHSanaei *This reply was generated automatically; a maintainer may follow up.*
Author
Owner

@diegogarciarojo commented on GitHub (Jul 19, 2026):

Thanks for the detailed analysis. You are completely right. The issue is exactly as you described, and the core blocker is that the v3.5.0 UI still enforces min={1} per field for Vision testseed, making it impossible for users to just leave it blank to avoid the crash.

Here is the requested info:

  1. Testseed values on the affected inbound:
    I was using the panel defaults: [900, 500, 900, 256].

  2. Xray-core version running:
    v26.7.11 (bundled with 3.5.0).

  3. Panic log:
    I had to rollback my container to v3.4.2 immediately to keep my server online, so I couldn't pull the exact panic trace from a live connection attempt. However, your explanation matches my scenario perfectly: Xray-core booted fine, but connections immediately dropped to zero because of those testseed values.

For now, I am staying on v3.4.2. Dropping the testseed field entirely or adding a save-time guard in the panel sounds like the perfect solution

<!-- gh-comment-id:5013700317 --> @diegogarciarojo commented on GitHub (Jul 19, 2026): Thanks for the detailed analysis. You are completely right. The issue is exactly as you described, and the core blocker is that the v3.5.0 UI still enforces min={1} per field for Vision testseed, making it impossible for users to just leave it blank to avoid the crash. Here is the requested info: 1. Testseed values on the affected inbound: I was using the panel defaults: [900, 500, 900, 256]. 2. Xray-core version running: v26.7.11 (bundled with 3.5.0). 3. Panic log: I had to rollback my container to v3.4.2 immediately to keep my server online, so I couldn't pull the exact panic trace from a live connection attempt. However, your explanation matches my scenario perfectly: Xray-core booted fine, but connections immediately dropped to zero because of those testseed values. For now, I am staying on v3.4.2. Dropping the testseed field entirely or adding a save-time guard in the panel sounds like the perfect solution
Author
Owner

@MHSanaei commented on GitHub (Jul 23, 2026):

Fixed in #6083. A one-time migration strips finalmask.tcp from REALITY inbounds on upgrade, so a legacy inbound no longer crashes Xray-core at boot.

<!-- gh-comment-id:5059094294 --> @MHSanaei commented on GitHub (Jul 23, 2026): Fixed in #6083. A one-time migration strips finalmask.tcp from REALITY inbounds on upgrade, so a legacy inbound no longer crashes Xray-core at boot.
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#4183
No description provided.