mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[PR #5984] [CLOSED] fix(xray): validate generated egress targets #6044
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#6044
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/5984
Author: @Alishahrokhiii
Created: 7/15/2026
Status: ❌ Closed
Base:
main← Head:agent/validate-panel-egress-target📝 Commits (2)
fdaf989fix(xray): validate panel egress target4568031fix(xray): guard node and mtproto egress📊 Changes
2 files changed (+178 additions, -21 deletions)
View changed files
📝
internal/web/service/xray.go(+49 -20)📝
internal/web/service/xray_config_inject_test.go(+129 -1)📄 Description
What changed
Why
Panel, node, and routed MTProto egress can reference subscription-derived tags. If one of those tags disappears after a refresh or removal, the generated config could retain a routing rule pointing to a nonexistent target and expose a loopback SOCKS bridge that cannot forward traffic.
The shared guard now fails closed across all three generated egress paths: existing routing stays untouched and no unusable bridge is exposed. MTProto routing without an explicitly selected outbound keeps its existing default-route behavior.
Validation
go test ./internal/web/service -run '^TestInject(Panel|Node|Mtproto)Egress' -count=1go test ./... -count=1go test -race ./internal/web/service -run '^TestInject(Panel|Node|Mtproto)Egress' -count=1go vet ./internal/web/service/...npm run gen(clean)npm run typechecknpm run lintnpm run test(856 passed)npm run buildnpm run build-storybook🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.