mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #6444] [Bug]: HostFormModal hides Fingerprint when Security is "same", preserving stale override and breaking inbound inheritance #4365
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#4365
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @TheMRVX on GitHub (Sep 10, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6444
Describe the bug
In the Host modal (
frontend/src/pages/hosts/HostFormModal.tsx), setting Security to"same"completely hides the Fingerprint field becauseshowTlsevaluates tofalse.However:
"same"does not clear any previously selected fingerprint in the form state or database (hosts.fingerprint)."same".internal/sub/host_sub.go:71) checksif h.Fingerprint != ""and appliesep["fingerprint"] = h.Fingerprint, overriding the inbound's fingerprint.As a result, if a host previously had a fingerprint set (such as
edgeorios), and the user changes Security to"same"intending to inherit the inbound's new fingerprint (such asfirefoxorchrome), the stale fingerprint persists indefinitely in the database and is emitted in all client subscription links. On modern Xray-core versions (e.g. v26.9.9+ with REALITY post-quantum strict key exchange), this causes complete connection failure.How to reproduce the problem
firefox.realityand select Fingerprint:edge(or edit a pre-existing host that hadedge). Save the host.realitytosame. Notice that the Fingerprint field completely disappears from the modal.SELECT fingerprint FROM hosts ...) or fetch the subscription link (/sub/<sub_id>).&fp=edgeinstead of inheriting&fp=firefoxfrom the inbound.Expected behavior
When Security is set to
"same", users should be able to:allowCleardropdown so they can optionally override or clear it to inherit the inbound's fingerprint."same"should reset or allow unsettingfingerprintso stale values are not trapped in the database.Actual behavior
The Fingerprint input is unmounted/hidden, preventing the user from clearing or changing it, while the database keeps the stale value and overrides the inbound link.
Relevant logs & Code inspection
Excerpt from
3xui.log:(Subscription link emits stale
&fp=edgeparameter generated fromhosts.fingerprintdespite inbound being set tofirefox).Root cause in frontend (
frontend/src/pages/hosts/HostFormModal.tsx:94):When
security === 'same',showTlsisfalse, causing lines 302–325 (containing the Fingerprint FormField) not to render:Backend inheritance in
internal/sub/host_sub.go:71-73:Because the database still has
h.Fingerprint = "edge", it overrides the inbound'sfirefox.Environment Details (Mandatory per CONTRIBUTING.md#issues)
@github-actions[bot] commented on GitHub (Sep 10, 2026):
Confirmed — all three of your mechanical claims hold on the current default branch (v3.7.0 is the latest release, so you are already at the tip). It is a frontend defect: a host's TLS override fields stay live when Security is
same, but the modal only renders them fortls/reality, so a previously-set fingerprint becomes unreachable while it keeps being emitted.Workaround — no database access needed
The form store keeps the values of unmounted fields, so you can clear the fingerprint from the UI by briefly re-showing it:
tls(orreality). The Fingerprint field reappears, still holdingedge.×).same.fpagain.Step 4 does not undo step 3 because
useFormin this modal (frontend/src/pages/hosts/HostFormModal.tsx:89) does not setshouldUnregister, so React Hook Form's defaultfalseapplies, andUpdateHostGrouprewrites the rows rather than patching them, so an empty fingerprint really does persist.Evidence
1 — the field is unreachable under
same(frontend/src/pages/hosts/HostFormModal.tsx):name="fingerprint"occurs exactly once in the file, so there is no second affordance.2 — the stale value is still submitted.
onFinish(HostFormModal.tsx:155-163) spreads the entire form store into the payload and never runs it throughBulkAddHostSchema, sofingerprint: "edge"goes on the wire. That the codebase deliberately relies onshouldUnregister: falseretaining unbound sub-trees is stated atfrontend/src/pages/inbounds/form/InboundFormModal.tsx:558-561.3 — the backend stores it verbatim.
internal/web/service/host.go:135isFingerprint: req.Fingerprint, andUpdateHostGroup(internal/web/service/host.go:247-273) deletes the group and re-creates the rows. Nothing normalisesFingerprintagainstreq.Security.4 — it still reaches the link under
same.internal/sub/host_sub.go:71-72:hostSecurityToForceTls(internal/sub/host_sub.go:176-183) maps"same"→"same";internal/sub/endpoint.go:98-101then keeps the inbound's security:so with a REALITY inbound
securityToApply == "reality"andapplyEndpointRealityParams(internal/sub/host_sub.go:305-307) runsparams["fp"] = fp. Your&fp=edgeis exactly that line.Scope is wider than Fingerprint
The same
showTlsgate also hidessni,overrideSniFromAddressandkeepSniBlank(HostFormModal.tsx:308-324), andshowTlsExtrashidesalpn,pinnedPeerCertSha256,verifyPeerCertByName,allowInsecureandechConfigList(HostFormModal.tsx:330-360). Under Securitysameover a TLS inbound a stalesniis trapped and applied the same way, viaapplyExternalProxyTLSParams(internal/sub/service.go:1890). Worth addressing in one pass rather than forfingerprintalone.What is not a bug
The backend override itself is intended, not accidental.
TestSub_HostRealitySniOverride(internal/sub/host_sub_test.go:369-395) pins it: a host'ssni+fpwin over the inbound's whilepbk/sidare inherited. So this belongs in the modal's render gate, not ininternal/sub/host_sub.go.Verdict: Confirmed bug
Severity: Medium — a UI-only trap on a specific edit sequence (host had a fingerprint, then Security switched to
same), with a full in-panel workaroundConfidence: High for the mechanism; every step is cited below. Medium for your stated consequence (see Not determined)
Root cause:
frontend/src/pages/hosts/HostFormModal.tsx:94—showTlsexcludes'same', so the render gate at:306unmounts the Fingerprint/SNI fields while their values remain in the RHF store (useFormat:89, noshouldUnregister) and are submitted byonFinish(:155-163) without schema normalisation. Trigger: an existing host with a non-emptyfingerprint(orsni) whose Security is changed tosameover atls/realityinbound. Introduced by709b332dfeat(hosts): managed Hosts for per-host subscription link overrides (#5409), which added theshowTlsline with the field set it gates.Already fixed: Still present on the default branch (
git log -S "const showTls = security" -- frontend/src/pages/hosts/HostFormModal.tsxreturns only709b332d)Duplicate of: None.
gh issue list --search "hosts security same" --state allandgh search prs --repo MHSanaei/3x-ui "host fingerprint" --mergedsurfaced no report or merged fix for this pathEvidence:
HostFormModal.tsx:94,:306,:325-327,:155-163,:89;InboundFormModal.tsx:558-561(theshouldUnregister: falsereliance);internal/web/service/host.go:135,:247-273;internal/sub/host_sub.go:71-72,:176-183,:305-307;internal/sub/endpoint.go:98-101;internal/sub/service.go:1890;internal/sub/host_sub_test.go:369-395(pins the override as intended)Not determined: Whether
fp=edgeon its own causes a total handshake failure on Xray-core v26.9.9 REALITY, as opposed to a degraded/fingerprintable one. The panel'spqvparam maps tomldsa65Verifyatinternal/util/link/outbound.go:677— the ML-DSA-65 signature, not the ML-KEM key exchange you describe — so the failure mode is Xray-core client behaviour I cannot exercise here. It does not affect the verdict. A client log from Xray withfp=edgeversusfp=firefoxagainst the same inbound would settle it.Suggested fix: Keep the Security tab's override fields reachable when Security is
same, since they are live in that mode — i.e. widen theshowTls/showTlsExtraspredicates atHostFormModal.tsx:94-95rather than adding clearing logic. Fingerprint and SNI already have a clear affordance (allowClear, and the''= None option built at:132-139), so exposure alone restores the escape hatch.This reply was generated automatically; a maintainer may follow up.