mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5831] [Bug]: The problem is activating Final Mask in the host section #4053
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#4053
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 @rasa68 on GitHub (Jul 6, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5831
Describe the bug
When we enable one of the options in the Final Mask tab on the host, for example, Fragment, this option is not included in the Final Mask box on the user's client! However, when we enable the Final Mask in the inbound settings, it is included in the user's client without any problems.
How to reproduce the problem
Expected behavior
No response
Actual behavior
No response
Relevant logs
Screenshots
No response
3x-ui version
34.2
Xray-core version
No response
How did you install 3x-ui?
install.sh script
Operating system
Ubuntu 22.04.5
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
@github-actions[bot] commented on GitHub (Jul 6, 2026):
Confirmed as a real bug in the current code (
main, matching the reported panel version 3.4.2).Root cause: a Host's
Final Maskvalue is only merged into the JSON and Clash subscription outputs, not into the plain/raw share links (vless://,trojan://,vmess://,ss://) that a client's "Final Mask" box is populated from via thefm=parameter.hostToExternalProxyMap()(internal/sub/host_sub.go:104-106) does copy the host'sFinalMaskonto the synthetic endpoint (ep["finalMask"]).applyHostStreamOverrides()merges that per-host mask into the per-host stream before it's rendered (internal/sub/json_service.go:203), and the same happens for Clash (internal/sub/clash_service.go:196).genVlessLink,genTrojanLink,genShadowsocksLink,genVmessLinkininternal/sub/service.go), thefmquery param is computed exactly once from the inbound's ownstreamSettings.finalmask(e.g.internal/sub/service.go:786-788) before the code branches into per-host endpoints. The per-endpoint override path (buildEndpointLinksininternal/sub/endpoint.go:76-103) applies TLS, Reality SNI/fingerprint, host header/path, and allow-insecure overrides per host, but there is no equivalent step that mergesep["finalMask"]intoparams["fm"]. So a mask configured only at the host level never reaches the raw share link, while a mask configured on the inbound itself is picked up correctly (matching what you observed).This explains the exact symptom: Final Mask set on the inbound works everywhere, but Final Mask set only on a Host is silently dropped from the plain subscription/share link (it does still take effect in the JSON-format subscription, if you want to confirm that as a workaround).
This is a code-level bug that needs a fix in
internal/sub/service.go/internal/sub/endpoint.go(adding a per-endpoint finalmask merge to the raw-link path, mirroringapplyHostStreamOverrides), not a configuration issue on your end, so no further logs are needed from you at this time.This reply was generated automatically from the repository source; a maintainer may follow up.