mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6375] [MERGED] fix(sub): randomize fresh panel subscription paths #6238
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#6238
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?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/6375
Author: @rokokol
Created: 8/31/2026
Status: ✅ Merged
Merged: 9/3/2026
Merged by: @MHSanaei
Base:
main← Head:fix/random-subscription-paths📝 Commits (2)
0f8348efix(sub): randomize fresh panel subscription paths7c733b1fix(sub): regenerate paths on settings reset📊 Changes
20 files changed (+285 additions, -158 deletions)
View changed files
📝
docs/components/tools/subscription-builder.tsx(+4 -4)📝
docs/content/docs/en/config/subscription.mdx(+6 -6)📝
docs/content/docs/en/reference/api/clients.mdx(+10 -8)📝
docs/content/docs/en/reference/api/subscription-server.mdx(+25 -22)📝
docs/content/docs/fa/config/subscription.mdx(+6 -6)📝
docs/content/docs/fa/reference/api/clients.mdx(+11 -9)📝
docs/content/docs/fa/reference/api/subscription-server.mdx(+22 -21)📝
docs/content/docs/ru/config/subscription.mdx(+6 -6)📝
docs/content/docs/ru/reference/api/clients.mdx(+11 -9)📝
docs/content/docs/ru/reference/api/subscription-server.mdx(+22 -21)📝
docs/content/docs/zh/config/subscription.mdx(+6 -6)📝
docs/content/docs/zh/reference/api/clients.mdx(+5 -5)📝
docs/content/docs/zh/reference/api/subscription-server.mdx(+14 -14)📝
docs/public/openapi.json(+5 -5)📝
frontend/public/openapi.json(+5 -5)📝
frontend/src/pages/api-docs/endpoints.ts(+5 -5)📝
internal/database/db.go(+21 -0)📝
internal/database/db_seed_test.go(+51 -0)📝
internal/web/service/setting.go(+11 -6)📝
internal/web/service/setting_security_test.go(+39 -0)📄 Description
Summary
Why
3x-ui currently ships the well-known
/sub/and/json/subscription paths, and the Settings page itself reports both as security warnings. Although each subscription still has its own secretsubId, a fixed service path makes the public subscription endpoints immediately recognizable and leaves every new panel with a warning that requires manual remediation.Changing these paths after clients have been provisioned changes every subscription URL. Operators then have to rotate and redistribute those URLs just to remove an insecure default they did not choose. Generating panel-specific paths at database creation makes fresh installations safe by default and avoids that later operational churn.
The Clash path is randomized as well so all public subscription formats follow the same default. This is limited to fresh databases deliberately: silently changing paths during an upgrade would cause the exact URL rotation this change is intended to prevent.
The randomized prefix is defense-in-depth, not a replacement for the per-subscription
subId.Testing
make test-gomake lint-gogo build ./...🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.