[GH-ISSUE #6555] [Enhancement]: carry support-x25519mlkem768 in vless:// share links, not just Clash subs (follow-up to #6451) #4391

Closed
opened 2026-10-31 20:39:20 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @jshir700 on GitHub (Sep 15, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6555

Describe the bug

Xray-core v26.9.8 requires the REALITY ClientHello to carry X25519MLKEM768 before the optional X25519 key share, otherwise the handshake is silently redirected to the fallback target. Non-Xray clients (Mihomo, Surge, etc.) need support-x25519mlkem768: true in their REALITY config.

PR #6451 (merged 2026-09-11, released in v3.8.0) correctly added backend support — internal/sub/clash_service.go:1135 unconditionally sets realityOpts["support-x25519mlkem768"] = true for all Clash-sub REALITY proxies. The test TestBuildProxy_VLESSRealityFieldsForClash asserts this. Documentation was also updated in 4 languages.

However, PR #6451 did not touch any frontend files. There is no schema entry, no form field, no VLESS link-generation parameter, and no URI-query parsing for this flag. Users who rely on VLESS share links (not Clash subs) will hit the v26.9.8+ breakage even on the latest panel version.

This means:

  • Clash subscriptions: ✅ work correctly (backend auto-injects the flag)
  • VLESS share links: ❌ missing support-x25519mlkem768, may fail against v26.9.8+ servers
  • Outbound REALITY form: ❌ no toggle to set or review this setting

How to reproduce the problem

  1. Upgrade to 3x-ui v3.8.0 and Xray-core v26.9.9.
  2. Create a VLESS inbound with REALITY security in the panel.
  3. Copy the VLESS share link — observe it contains pbk, sid, spx, fp, sni, flow but no support-x25519mlkem768.
  4. Paste the link into Mihomo/Surge — the client lacks the ML-KEM flag and may fail to connect.
  5. Open the Clash subscription for the same panel — it does contain support-x25519mlkem768: true.

The output is inconsistent: same panel, same server, two different client outputs.

Expected behavior

  • The VLESS share link should include support-x25519mlkem768=true for REALITY inbounds (matching what the Clash sub emits).
  • The outbound REALITY form should have a visible toggle for this setting.
  • Importing a VLESS link with support-x25519mlkem768=true should populate the form field.
  • Frontend output should be consistent with the backend's Clash-sub behavior.

Actual behavior

The following frontend paths are missing this field entirely:

File Current state What's missing
frontend/src/schemas/protocols/security/reality.ts RealityClientSettingsSchema has 5 fields No supportX25519Mlkem768
frontend/src/pages/xray/outbounds/security/reality.tsx Renders 6 fields (SNI, uTLS, shortId, spiderX, publicKey, mldsa65Verify) No Switch
frontend/src/lib/xray/inbound-link.ts Emits pbk/fp/sni/sid/spx/pqv Doesn't emit support-x25519mlkem768
frontend/src/lib/xray/outbound-link-parser.ts Parses the 6 params above Doesn't parse support-x25519mlkem768
docs/lib/xray/reality.ts RealityConfig interface + realityClientLink() Missing the field

Relevant logs

## Code-level analysis

### What PR #6451 changed (backend only)

PR [#6451](https://github.com/MHSanaei/3x-ui/pull/6451) modified only these files:
- `internal/sub/clash_service.go` (+3 lines) — auto-injects `support-x25519mlkem768: true`
- `internal/sub/clash_service_test.go` (+45 lines) — tests
- `docs/content/docs/{en,fa,ru,zh}/config/reality.mdx` — documentation updates

**No frontend files were touched.** This left a gap: Clash subs work, but VLESS share links don't carry the flag.

### What the frontend needs — exact changes

**File 1: `frontend/src/schemas/protocols/security/reality.ts`**

Add to `RealityClientSettingsSchema`:

supportX25519Mlkem768: z.boolean().default(false),

And to the default factory.

**File 2: `frontend/src/pages/xray/outbounds/security/reality.tsx`**

Add a Switch after the `mldsa65Verify` field (pattern: same as `show` on inbound side):

<FormField
  name={['streamSettings', 'realitySettings', 'supportX25519Mlkem768']}
  label="Support X25519MLKEM768"
  valueProp="checked"
>
  <Switch />
</FormField>


**File 3: `frontend/src/lib/xray/outbound-link-parser.ts`**

- `buildStream()` reality defaults (line ~180): add `supportX25519Mlkem768: false`
- `applySecurityParams()` reality branch (line ~488): parse `params.get('support-x25519mlkem768')`

**File 4: `frontend/src/lib/xray/inbound-link.ts`**

Two places emit reality params — add after the `pqv` line in each:

if (reality.settings.supportX25519Mlkem768) {
  params.set('support-x25519mlkem768', 'true');
}


**File 5: `docs/lib/xray/reality.ts`**

Update `RealityConfig` interface and `realityClientLink()` params.

**File 6: `frontend/src/test/golden/fixtures/inbound-full/vless-tcp-reality.json`**

Add `supportX25519Mlkem768: false` to the fixture's `settings` object.

**File 7: `frontend/src/test/outbound-link-parser.test.ts`**

Add a test case parsing a VLESS link with `support-x25519mlkem768=true`.

## Why this matters

- The backend (Clash subs) is correct; the frontend (VLESS links) is not. Users who copy share links from the panel will experience silent connection failures after upgrading their Xray server to v26.9.8+.
- This is a minimal follow-up to PR #6451 — the backend change was correct but incomplete; the frontend was overlooked.
- [MetaCubeX/mihomo#3199](https://github.com/MetaCubeX/mihomo/pull/3199) (merged) already added URI-param support on the Mihomo side; 3x-ui should emit compatible links.
- This is not a new feature request — the backend already does the right thing. The fix is to bring the frontend up to parity.

## Acceptance criteria

- [ ] VLESS share links for REALITY inbounds include `support-x25519mlkem768=true`.
- [ ] Outbound REALITY form shows a "Support X25519MLKEM768" toggle.
- [ ] Importing a VLESS link with `support-x25519mlkem768=true` populates the toggle correctly.
- [ ] `npm run test` passes; golden fixtures updated.
- [ ] i18n key added to all 13 locale files.
- [ ] `make gen` clean; `make verify` green.
- [ ] Existing Clash-sub behavior unchanged.
- [ ] New test covering the round-trip: form → link → import → form state preserved.

Screenshots

N/A — the field simply does not exist in the UI.

3x-ui version

v3.8.0 (commit 837addf6, released 2026-09-14) — the latest release

Xray-core version

Server: v26.9.8+ (breakage threshold); Client: any non-Xray client that needs the flag

How did you install 3x-ui?

install.sh script

Operating system

Any

Which parts of the panel are affected?

Frontend (UI / panel pages), Xray config generation, Subscription (share links / Clash / JSON)

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 @jshir700 on GitHub (Sep 15, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6555 ### Describe the bug [Xray-core v26.9.8](https://github.com/XTLS/Xray-core/issues/6477) requires the REALITY ClientHello to carry `X25519MLKEM768` **before** the optional `X25519` key share, otherwise the handshake is silently redirected to the fallback target. Non-Xray clients (Mihomo, Surge, etc.) need `support-x25519mlkem768: true` in their REALITY config. **PR [#6451](https://github.com/MHSanaei/3x-ui/pull/6451)** (merged 2026-09-11, released in **v3.8.0**) correctly added backend support — `internal/sub/clash_service.go:1135` unconditionally sets `realityOpts["support-x25519mlkem768"] = true` for all Clash-sub REALITY proxies. The test `TestBuildProxy_VLESSRealityFieldsForClash` asserts this. Documentation was also updated in 4 languages. However, **PR #6451 did not touch any frontend files**. There is no schema entry, no form field, no VLESS link-generation parameter, and no URI-query parsing for this flag. Users who rely on VLESS share links (not Clash subs) will hit the v26.9.8+ breakage even on the latest panel version. This means: - **Clash subscriptions**: ✅ work correctly (backend auto-injects the flag) - **VLESS share links**: ❌ missing `support-x25519mlkem768`, may fail against v26.9.8+ servers - **Outbound REALITY form**: ❌ no toggle to set or review this setting ### How to reproduce the problem 1. Upgrade to 3x-ui **v3.8.0** and Xray-core **v26.9.9**. 2. Create a VLESS inbound with REALITY security in the panel. 3. Copy the VLESS share link — observe it contains `pbk`, `sid`, `spx`, `fp`, `sni`, `flow` but **no** `support-x25519mlkem768`. 4. Paste the link into Mihomo/Surge — the client lacks the ML-KEM flag and may fail to connect. 5. Open the Clash subscription for the same panel — it **does** contain `support-x25519mlkem768: true`. The output is inconsistent: same panel, same server, two different client outputs. ### Expected behavior - The VLESS share link should include `support-x25519mlkem768=true` for REALITY inbounds (matching what the Clash sub emits). - The outbound REALITY form should have a visible toggle for this setting. - Importing a VLESS link with `support-x25519mlkem768=true` should populate the form field. - Frontend output should be consistent with the backend's Clash-sub behavior. ### Actual behavior The following frontend paths are missing this field entirely: | File | Current state | What's missing | |------|---------------|----------------| | `frontend/src/schemas/protocols/security/reality.ts` | `RealityClientSettingsSchema` has 5 fields | No `supportX25519Mlkem768` | | `frontend/src/pages/xray/outbounds/security/reality.tsx` | Renders 6 fields (SNI, uTLS, shortId, spiderX, publicKey, mldsa65Verify) | No Switch | | `frontend/src/lib/xray/inbound-link.ts` | Emits `pbk`/`fp`/`sni`/`sid`/`spx`/`pqv` | Doesn't emit `support-x25519mlkem768` | | `frontend/src/lib/xray/outbound-link-parser.ts` | Parses the 6 params above | Doesn't parse `support-x25519mlkem768` | | `docs/lib/xray/reality.ts` | `RealityConfig` interface + `realityClientLink()` | Missing the field | ### Relevant logs ```shell ## Code-level analysis ### What PR #6451 changed (backend only) PR [#6451](https://github.com/MHSanaei/3x-ui/pull/6451) modified only these files: - `internal/sub/clash_service.go` (+3 lines) — auto-injects `support-x25519mlkem768: true` - `internal/sub/clash_service_test.go` (+45 lines) — tests - `docs/content/docs/{en,fa,ru,zh}/config/reality.mdx` — documentation updates **No frontend files were touched.** This left a gap: Clash subs work, but VLESS share links don't carry the flag. ### What the frontend needs — exact changes **File 1: `frontend/src/schemas/protocols/security/reality.ts`** Add to `RealityClientSettingsSchema`: supportX25519Mlkem768: z.boolean().default(false), And to the default factory. **File 2: `frontend/src/pages/xray/outbounds/security/reality.tsx`** Add a Switch after the `mldsa65Verify` field (pattern: same as `show` on inbound side): <FormField name={['streamSettings', 'realitySettings', 'supportX25519Mlkem768']} label="Support X25519MLKEM768" valueProp="checked" > <Switch /> </FormField> **File 3: `frontend/src/lib/xray/outbound-link-parser.ts`** - `buildStream()` reality defaults (line ~180): add `supportX25519Mlkem768: false` - `applySecurityParams()` reality branch (line ~488): parse `params.get('support-x25519mlkem768')` **File 4: `frontend/src/lib/xray/inbound-link.ts`** Two places emit reality params — add after the `pqv` line in each: if (reality.settings.supportX25519Mlkem768) { params.set('support-x25519mlkem768', 'true'); } **File 5: `docs/lib/xray/reality.ts`** Update `RealityConfig` interface and `realityClientLink()` params. **File 6: `frontend/src/test/golden/fixtures/inbound-full/vless-tcp-reality.json`** Add `supportX25519Mlkem768: false` to the fixture's `settings` object. **File 7: `frontend/src/test/outbound-link-parser.test.ts`** Add a test case parsing a VLESS link with `support-x25519mlkem768=true`. ## Why this matters - The backend (Clash subs) is correct; the frontend (VLESS links) is not. Users who copy share links from the panel will experience silent connection failures after upgrading their Xray server to v26.9.8+. - This is a minimal follow-up to PR #6451 — the backend change was correct but incomplete; the frontend was overlooked. - [MetaCubeX/mihomo#3199](https://github.com/MetaCubeX/mihomo/pull/3199) (merged) already added URI-param support on the Mihomo side; 3x-ui should emit compatible links. - This is not a new feature request — the backend already does the right thing. The fix is to bring the frontend up to parity. ## Acceptance criteria - [ ] VLESS share links for REALITY inbounds include `support-x25519mlkem768=true`. - [ ] Outbound REALITY form shows a "Support X25519MLKEM768" toggle. - [ ] Importing a VLESS link with `support-x25519mlkem768=true` populates the toggle correctly. - [ ] `npm run test` passes; golden fixtures updated. - [ ] i18n key added to all 13 locale files. - [ ] `make gen` clean; `make verify` green. - [ ] Existing Clash-sub behavior unchanged. - [ ] New test covering the round-trip: form → link → import → form state preserved. ``` ### Screenshots N/A — the field simply does not exist in the UI. ### 3x-ui version v3.8.0 (commit `837addf6`, released 2026-09-14) — the latest release ### Xray-core version Server: v26.9.8+ (breakage threshold); Client: any non-Xray client that needs the flag ### How did you install 3x-ui? install.sh script ### Operating system Any ### Which parts of the panel are affected? Frontend (UI / panel pages), Xray config generation, Subscription (share links / Clash / JSON) ### 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).
Author
Owner

@github-actions[bot] commented on GitHub (Sep 15, 2026):

Your reading of the frontend is accurate — every file and field you list checks out — but this is not a defect left behind by #6451, so I have reclassified it from bug to enhancement. support-x25519mlkem768 is a Clash/Mihomo YAML key under reality-opts; it is not an Xray-core REALITY field and it is not part of the vless:// URI schema the panel emits. #6451 left link generation alone deliberately, and said so in the documentation it shipped.

What I confirmed in the source

Your table is correct, field for field:

  • frontend/src/schemas/protocols/security/reality.ts — RealityClientSettingsSchema has exactly publicKey, fingerprint, serverName, spiderX, mldsa65Verify.
  • frontend/src/lib/xray/inbound-link.ts:454-471 sets security/pbk/fp/sni/sid/spx/pqv and nothing else; the second emission site at :569-580 matches.
  • frontend/src/lib/xray/outbound-link-parser.ts:488-495 parses exactly those six reality params.
  • frontend/src/pages/xray/outbounds/security/reality.tsx renders the six fields you name.
  • A repo-wide, case-insensitive grep for x25519mlkem768 hits only internal/sub/clash_service.go:1135 and its two tests.

Why this is not "#6451 forgot the frontend"

The same commit (0a2cd789, fix(sub): enable ML-KEM for Mihomo REALITY subscriptions (#6451)) wrote this into docs/content/docs/en/config/reality.mdx:132-133:

Raw vless:// links do not carry this Mihomo option, so clients importing them directly still need a persistent override.

That is an explicit statement of scope, not an oversight: the Clash YAML subscription is a client config the panel generates, so it can set a Mihomo knob; a vless:// link is a transport descriptor and only carries XTLS URI-schema parameters.

Two corrections to the report itself:

  1. The injection is not unconditional. internal/sub/clash_service.go:1133 gates it:

    if len(realityOpts) > 0 {
        // Xray 26.9.8+ rejects REALITY handshakes without an ML-KEM key share.
        realityOpts["support-x25519mlkem768"] = true
        proxy["reality-opts"] = realityOpts
    }
    

    realityOpts is only populated from a non-empty publicKey or shortId (:1127-1132), so a REALITY node with neither gets no reality-opts block and no flag.

  2. Your file list would create a new inconsistency rather than remove one. The raw links a subscription actually serves are built in Go, not TypeScript: internal/sub/service.go:1916 applyShareRealityParams() emits sni/pbk/sid/fp/pqv/spx, and internal/util/link/outbound.go:746-753 parses them back. frontend/src/lib/xray/inbound-link.ts is the panel-UI mirror of that Go function. Patching only the frontend would make the panel's "copy link" button and the subscription URL hand out different links for the same client — the drift the "three independent link implementations" rule in CLAUDE.md exists to prevent. Separately, docs/lib/xray/reality.ts:97 realityClientLink() is a documentation example generator (it does not even carry pqv), not a panel code path.

On the outbound form toggle specifically: that form edits streamSettings.realitySettings.*, which is handed to Xray-core as the outbound's REALITY config — every field it renders (serverName, fingerprint, publicKey, shortId, spiderX, mldsa65Verify) is an Xray-core REALITY outbound field. I could not read the pinned github.com/xtls/xray-core v1.260327.1-0.20260908222543-52a412d9e2f5 source from this checkout, so treat this as an inference rather than a confirmed fact: nothing in this repository's Xray config surface knows a supportX25519Mlkem768 option, so a toggle there looks like it would write a key nothing reads. Mihomo's flag is a Mihomo knob, and the Clash YAML is the one output the panel controls where it belongs.

The one thing that decides whether this is worth doing

I could not verify that Mihomo parses support-x25519mlkem768 out of a vless:// URI at all. I have no network access in this environment, and the whole request rests on that claim. So:

  1. Please link the Mihomo source line that reads this query key — in its URI/subscription converter, not the YAML struct definition. With that, this is a small, well-defined change (Go builder + Go parser + the TS mirrors, kept in lockstep). Without it, emitting a non-standard query parameter into every REALITY link the panel hands out — to v2rayN, sing-box, Shadowrocket and Xray-core itself — is a cost with no demonstrated benefit.

What works today

  • For Mihomo/Clash clients, use the panel's Clash subscription URL rather than the raw vless:// link: it already carries the flag (internal/sub/clash_service.go:1135) and defaults client-fingerprint to chrome (:1138).
  • Note the caveat at reality.mdx:130-131 — the flag cannot rescue a fingerprint that does not offer ML-KEM; pick chrome with Mihomo's uTLS v1.8.7.

I retitled the issue from "[Bug]: frontend missing support-x25519mlkem768 for REALITY (follow-up to #6451)" because your own acceptance criteria need the Go link builder and parser too, not just the frontend.

Related, but a different root cause (the upstream Xray-core handshake change itself rather than link contents): #6543 and #6408. Neither is a duplicate of this.

Verdict: Feature request

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

<!-- gh-comment-id:5680927941 --> @github-actions[bot] commented on GitHub (Sep 15, 2026): Your reading of the frontend is accurate — every file and field you list checks out — but this is not a defect left behind by #6451, so I have reclassified it from `bug` to `enhancement`. `support-x25519mlkem768` is a Clash/Mihomo YAML key under `reality-opts`; it is not an Xray-core REALITY field and it is not part of the `vless://` URI schema the panel emits. #6451 left link generation alone deliberately, and said so in the documentation it shipped. ## What I confirmed in the source Your table is correct, field for field: - `frontend/src/schemas/protocols/security/reality.ts` — `RealityClientSettingsSchema` has exactly `publicKey`, `fingerprint`, `serverName`, `spiderX`, `mldsa65Verify`. - `frontend/src/lib/xray/inbound-link.ts:454-471` sets `security`/`pbk`/`fp`/`sni`/`sid`/`spx`/`pqv` and nothing else; the second emission site at `:569-580` matches. - `frontend/src/lib/xray/outbound-link-parser.ts:488-495` parses exactly those six reality params. - `frontend/src/pages/xray/outbounds/security/reality.tsx` renders the six fields you name. - A repo-wide, case-insensitive grep for `x25519mlkem768` hits only `internal/sub/clash_service.go:1135` and its two tests. ## Why this is not "#6451 forgot the frontend" The same commit (`0a2cd789`, `fix(sub): enable ML-KEM for Mihomo REALITY subscriptions (#6451)`) wrote this into `docs/content/docs/en/config/reality.mdx:132-133`: > Raw `vless://` links do not carry this Mihomo option, so clients importing them directly still need a persistent override. That is an explicit statement of scope, not an oversight: the Clash YAML subscription is a *client config* the panel generates, so it can set a Mihomo knob; a `vless://` link is a transport descriptor and only carries XTLS URI-schema parameters. Two corrections to the report itself: 1. The injection is **not** unconditional. `internal/sub/clash_service.go:1133` gates it: ```go if len(realityOpts) > 0 { // Xray 26.9.8+ rejects REALITY handshakes without an ML-KEM key share. realityOpts["support-x25519mlkem768"] = true proxy["reality-opts"] = realityOpts } ``` `realityOpts` is only populated from a non-empty `publicKey` or `shortId` (`:1127-1132`), so a REALITY node with neither gets no `reality-opts` block and no flag. 2. Your file list would create a **new** inconsistency rather than remove one. The raw links a subscription actually serves are built in **Go**, not TypeScript: `internal/sub/service.go:1916` `applyShareRealityParams()` emits `sni`/`pbk`/`sid`/`fp`/`pqv`/`spx`, and `internal/util/link/outbound.go:746-753` parses them back. `frontend/src/lib/xray/inbound-link.ts` is the panel-UI mirror of that Go function. Patching only the frontend would make the panel's "copy link" button and the subscription URL hand out different links for the same client — the drift the "three independent link implementations" rule in `CLAUDE.md` exists to prevent. Separately, `docs/lib/xray/reality.ts:97` `realityClientLink()` is a documentation example generator (it does not even carry `pqv`), not a panel code path. On the outbound form toggle specifically: that form edits `streamSettings.realitySettings.*`, which is handed to Xray-core as the outbound's REALITY config — every field it renders (`serverName`, `fingerprint`, `publicKey`, `shortId`, `spiderX`, `mldsa65Verify`) is an Xray-core REALITY outbound field. I could not read the pinned `github.com/xtls/xray-core v1.260327.1-0.20260908222543-52a412d9e2f5` source from this checkout, so treat this as an inference rather than a confirmed fact: nothing in this repository's Xray config surface knows a `supportX25519Mlkem768` option, so a toggle there looks like it would write a key nothing reads. Mihomo's flag is a Mihomo knob, and the Clash YAML is the one output the panel controls where it belongs. ## The one thing that decides whether this is worth doing I could not verify that Mihomo parses `support-x25519mlkem768` out of a `vless://` URI at all. I have no network access in this environment, and the whole request rests on that claim. So: 1. Please link the Mihomo **source line** that reads this query key — in its URI/subscription converter, not the YAML struct definition. With that, this is a small, well-defined change (Go builder + Go parser + the TS mirrors, kept in lockstep). Without it, emitting a non-standard query parameter into every REALITY link the panel hands out — to v2rayN, sing-box, Shadowrocket and Xray-core itself — is a cost with no demonstrated benefit. ## What works today - For Mihomo/Clash clients, use the panel's **Clash subscription** URL rather than the raw `vless://` link: it already carries the flag (`internal/sub/clash_service.go:1135`) and defaults `client-fingerprint` to `chrome` (`:1138`). - Note the caveat at `reality.mdx:130-131` — the flag cannot rescue a fingerprint that does not offer ML-KEM; pick `chrome` with Mihomo's uTLS v1.8.7. I retitled the issue from "[Bug]: frontend missing `support-x25519mlkem768` for REALITY (follow-up to #6451)" because your own acceptance criteria need the Go link builder and parser too, not just the frontend. Related, but a different root cause (the upstream Xray-core handshake change itself rather than link contents): #6543 and #6408. Neither is a duplicate of this. Verdict: Feature request *This reply was generated automatically; a maintainer may follow up.* <!-- claude-issue:analyst -->
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#4391
No description provided.