mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[PR #6028] [MERGED] fix: gate unencrypted VLESS outbound rejection on the running Xray core version #6056
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#6056
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/6028
Author: @mvanhorn
Created: 7/18/2026
Status: ✅ Merged
Merged: 7/21/2026
Merged by: @MHSanaei
Base:
main← Head:fix/5916-vless-outbound-core-version-gate📝 Commits (1)
c9062ecfix: gate embedded unencrypted-outbound rejection on running Xray core version📊 Changes
2 files changed (+107 additions, -0 deletions)
View changed files
📝
internal/web/service/xray_setting.go(+59 -0)📝
internal/web/service/xray_setting_test.go(+48 -0)📄 Description
Summary
Saving an Xray config that contains an unencrypted (
security: none) VLESS outbound to a public address is rejected even when the admin is running an older external Xray core that accepts it. This gates that panel-side rejection on the running core version, so a downgraded core behaves as it did before v3.5.0.Why
After v3.5.0,
XraySettingService.CheckXrayConfigvalidates every outbound through the panel's compile-time embeddedxtls/xray-core(pinned near v26.7.11), which unconditionally refuses unencrypted public outbounds. Admins who downgraded the external core to26.4.25(which accepts that config and passesxray run -test) still hit the panel refusal, because the check never consults which binary is actually selected. The rejection readsinfra/conf: vless without TLS or other encryption is prohibited unless the server address is a private IP or domain. A second user reported the same refusal merely editing routing rules under core26.6.27.Closes #5916
Type of change
Areas affected
How was this tested?
CheckXrayConfignow reads the running external core version via the existing package process (p.GetXrayVersion()). Only whenxray.ValidateOutboundConfigreturns the specific "prohibited" error AND the running core parses to a version older than26.7.11does it skip that one outbound instead of aborting the whole save. Unknown, unparseable, or>= 26.7.11versions keep today's strict behavior as the safe default.xray.ValidateOutboundConfigitself is untouched, so the embedded rule still fires for modern cores.Added unit tests in
internal/web/service/xray_setting_test.gofor the version-gate helper and the local 3-part version comparison, including boundary cases around26.7.11and unknown/malformed versions.go build ./...passesgo test ./internal/web/service/...passesgo test ./internal/xray/...(the embedded-validator regression test) stays greenScreenshots / recordings
N/A - backend validation fix, no UI change.
Breaking changes
None. Modern cores (
>= 26.7.11) and unknown versions keep the existing strict validation.Checklist
go build ./...and the test suite pass locally.AI disclosure
AI was used for assistance.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.