mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #6725] [Feature]: Hide raw config links on subscription webpage when HWID limit is enabled #4481
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#4481
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 @typedevone on GitHub (Oct 3, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6725
Is your feature request related to a problem?
Yes.
3x-ui 3.9.0 includes per-client HWID device limits, which is a very useful feature for restricting a subscription to a specific number of devices.
However, the current subscription webpage undermines this protection.
When a user opens their subscription URL in a normal browser, the page still displays the individual proxy configurations and allows them to be copied.
This means a user can open the subscription page, copy the raw configuration URL, and manually import/share it with another client or device.
The subscription request itself may be protected by the HWID limit, but once the raw configuration is exposed through the browser subscription page, it can be extracted and used independently. As a result, the HWID subscription limit does not fully achieve its purpose of limiting how many devices can use the configuration.
Some clients such as Happ provide encrypted-link mechanisms that can make the subscription URL less accessible to the user, but this is only a client-specific workaround. Other clients are also widely used, so the restriction should be enforced by 3x-ui itself rather than relying on individual client behavior
Describe the solution you'd like
Please add an option to prevent raw proxy configurations from being displayed on the browser subscription webpage.
Ideally, when HWID limiting is enabled for a client, opening the subscription URL from a regular browser should not expose individual raw configuration links for subscription-capable protocols, such as vless://, vmess://, trojan://, etc.
The browser page could instead show only subscription information/status, such as:
The actual subscription endpoint should continue working normally for compatible proxy clients that request and process the subscription.
WireGuard, AmneziaWG, and Telegram proxy configurations should be excluded from this restriction and should remain visible on the subscription webpage. Their respective clients do not import configurations through 3x-ui subscription URLs in the same way as VLESS/VMess/Trojan/Etc-compatible clients. Hiding these configurations would therefore prevent users from obtaining the information they need to configure those clients.
In other words, the proposed behavior should distinguish between:
Subscription-capable configs (VLESS, VMess, Trojan, etc.) — hide their raw configuration links on the webpage when this protection is enabled. Users should consume these through the subscription URL.
Configs that require direct/manual import (WireGuard, AmneziaWG, Telegram proxy) — continue displaying their configuration details/links on the webpage so users can import or configure them normally.
This could either:
The important part is that a normal browser request should not provide an easy way to extract raw connection URLs that can otherwise be obtained and used independently of the HWID-protected subscription mechanism, while protocols that depend on manual configuration remain accessible.
Alternatives you've considered
Happ encrypted subscription links can partially mitigate this by preventing users from easily seeing/copying the original subscription URL inside Happ.
However, this is client-specific and does not solve the underlying issue. Users may use other clients or simply open the subscription URL in a browser.
Another workaround would be a custom subscription-page template that hides the links, but this should ideally be an official security/restriction option integrated with the HWID functionality.
Concrete use case
An administrator creates a client and sets:
HWID Device Limit: 1
The intention is that the subscription can only be used by one registered device.
The user imports the subscription into their client and the HWID mechanism correctly limits subscription access.
However, the same user can open the subscription URL in a browser, copy the displayed vless://... configuration, and import/share that raw configuration elsewhere.
This bypasses the practical purpose of the HWID device restriction.
With the proposed option enabled, opening the subscription URL in a browser would display subscription/account information but would not reveal raw VLESS/VMess/Trojan/etc. connection configurations.
WireGuard, AmneziaWG, and Telegram proxy configurations would remain visible because their clients require users to obtain/import the configuration directly rather than consuming it through the normal subscription mechanism.
Mockups, screenshots, or examples
Current behavior:
Subscription URL → Browser → all individual configs are visible and copyable
Proposed behavior when config hiding/HWID protection is enabled:
Subscription URL → Browser → subscription status/info + WG/AWG/Telegram configs; raw subscription-capable configs are hidden
Proxy clients should still be able to retrieve the hidden configurations through the appropriate subscription request/format.
Which parts of the panel would this affect?
Subscription (share links / Clash / JSON), Frontend (UI / panel pages)
Are you willing to help?
Before submitting
@github-actions[bot] commented on GitHub (Oct 3, 2026):
This is a valid feature request. The current code works as you describe, and the behaviour is deliberate: the browser subscription page is exempt from the HWID gate by design, and no setting hides its links today.
What the code does now
internal/sub/controller.go:464-476,subs()serves the HTML page (maybeServeSubPage) before it callsenforceHwid. A browser request (Accept: text/html,?html=1or?view=html) therefore returns before the HWID check runs:TestSubscriptionHwidGateSkipsHtmlInfoPage(internal/sub/hwid_controller_test.go:136) asserts"HTML sub page should not be HWID-gated". Both the gate and that test arrived in694ad6de feat(sub): add per-client subscription HWID limits (#5802).BuildPageData(internal/sub/service.go:3219-3230) copies every generated link into the page data. The only path that strips them is the JSON?format=infoview (controller.go:412,delete(info, "links")), which proves a links-free view already exists server-side. The HTML page has no matching switch.subHideSettings(internal/web/service/setting.go:117), is a header sent to client apps. It does not hide anything on the web page.A limit worth knowing before this is built
HWID is enforced only when the subscription is fetched.
LimitHwidis used ininternal/web/service/(client_hwid.go,client_crud.go, ...) and nowhere ininternal/xray/, so Xray does not check it when a connection comes in. A device that has already registered gets the samevless:///vmess://lines in the raw body (controller.go:487-519), and many client apps let users view or export them. Hiding the links on the HTML page would close the easiest way to leak a config, but it would not bind a config to a device. The issue should be scoped with that in mind. The same split would apply to the JSON and Clash bodies, which also carry full outbounds.Implementation notes
If this is built, the natural place is
buildSubPageData/BuildPageData. FilterPageDatalinks by protocol there, keeping WireGuard, AmneziaWG and MTProto, so the links are never sent to the browser. Hiding them only in the React page would leave them in the HTML payload.Verdict: Feature request
This reply was generated automatically; a maintainer may follow up.