[GH-ISSUE #6725] [Feature]: Hide raw config links on subscription webpage when HWID limit is enabled #4481

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

Originally created by @typedevone on GitHub (Oct 3, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6725

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:

  • Subscription name
  • Traffic usage / remaining traffic
  • Expiration date
  • A message instructing the user to import the subscription URL into a supported client

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:

  • Be enabled automatically whenever an HWID limit is configured for the client, or
  • Be provided as a per-client/global option such as "Hide subscription-capable configs on subscription webpage".

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?

  • I'd like to implement this feature myself and open a PR.
  • I can help test once a PR is open.

Before submitting

  • I searched existing issues and this feature has not been requested.
  • This feature request is written in English.
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: - Subscription name - Traffic usage / remaining traffic - Expiration date - A message instructing the user to import the subscription URL into a supported client 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: - Be enabled automatically whenever an HWID limit is configured for the client, or - Be provided as a per-client/global option such as "Hide subscription-capable configs on subscription webpage". 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? - [ ] I'd like to implement this feature myself and open a PR. - [x] I can help test once a PR is open. ### Before submitting - [x] I searched [existing issues](../issues?q=is%3Aissue) and this feature has not been requested. - [x] This feature request is written in English.
Author
Owner

@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

  • In internal/sub/controller.go:464-476, subs() serves the HTML page (maybeServeSubPage) before it calls enforceHwid. A browser request (Accept: text/html, ?html=1 or ?view=html) therefore returns before the HWID check runs:
    if a.maybeServeSubPage(c) { ... return }
    if !a.enforceHwid(c) { return }
    
  • A test pins this as intended: TestSubscriptionHwidGateSkipsHtmlInfoPage (internal/sub/hwid_controller_test.go:136) asserts "HTML sub page should not be HWID-gated". Both the gate and that test arrived in 694ad6de 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=info view (controller.go:412, delete(info, "links")), which proves a links-free view already exists server-side. The HTML page has no matching switch.
  • The only nearby setting, 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. LimitHwid is used in internal/web/service/ (client_hwid.go, client_crud.go, ...) and nowhere in internal/xray/, so Xray does not check it when a connection comes in. A device that has already registered gets the same vless:///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. Filter PageData links 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.

<!-- gh-comment-id:5973979203 --> @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** - In `internal/sub/controller.go:464-476`, `subs()` serves the HTML page (`maybeServeSubPage`) before it calls `enforceHwid`. A browser request (`Accept: text/html`, `?html=1` or `?view=html`) therefore returns before the HWID check runs: ```go if a.maybeServeSubPage(c) { ... return } if !a.enforceHwid(c) { return } ``` - A test pins this as intended: `TestSubscriptionHwidGateSkipsHtmlInfoPage` (`internal/sub/hwid_controller_test.go:136`) asserts `"HTML sub page should not be HWID-gated"`. Both the gate and that test arrived in `694ad6de 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=info` view (`controller.go:412`, `delete(info, "links")`), which proves a links-free view already exists server-side. The HTML page has no matching switch. - The only nearby setting, `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**. `LimitHwid` is used in `internal/web/service/` (`client_hwid.go`, `client_crud.go`, ...) and nowhere in `internal/xray/`, so Xray does not check it when a connection comes in. A device that has already registered gets the same `vless://`/`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`. Filter `PageData` links 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.* <!-- 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#4481
No description provided.