[PR #6028] [MERGED] fix: gate unencrypted VLESS outbound rejection on the running Xray core version #6056

Closed
opened 2026-11-02 04:06:04 +07:00 by bsakaguchi · 0 comments
Owner

📋 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)

  • c9062ec fix: 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.CheckXrayConfig validates every outbound through the panel's compile-time embedded xtls/xray-core (pinned near v26.7.11), which unconditionally refuses unencrypted public outbounds. Admins who downgraded the external core to 26.4.25 (which accepts that config and passes xray run -test) still hit the panel refusal, because the check never consults which binary is actually selected. The rejection reads infra/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 core 26.6.27.

Closes #5916

Type of change

  • Bug fix
  • New feature
  • Refactoring (no behavior change)
  • Documentation
  • Tests only
  • Build / CI / tooling
  • Other

Areas affected

  • Frontend (UI / panel pages)
  • Backend (API endpoints, login, settings)
  • Xray config generation
  • Subscription (share links / Clash / JSON)
  • Statistics / traffic counters
  • Database / migrations
  • Install / upgrade script
  • Docker image
  • Multi-node (sub-nodes)
  • Telegram bot

How was this tested?

CheckXrayConfig now reads the running external core version via the existing package process (p.GetXrayVersion()). Only when xray.ValidateOutboundConfig returns the specific "prohibited" error AND the running core parses to a version older than 26.7.11 does it skip that one outbound instead of aborting the whole save. Unknown, unparseable, or >= 26.7.11 versions keep today's strict behavior as the safe default. xray.ValidateOutboundConfig itself is untouched, so the embedded rule still fires for modern cores.

Added unit tests in internal/web/service/xray_setting_test.go for the version-gate helper and the local 3-part version comparison, including boundary cases around 26.7.11 and unknown/malformed versions.

  • go build ./... passes
  • go test ./internal/web/service/... passes
  • go test ./internal/xray/... (the embedded-validator regression test) stays green

Screenshots / 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

  • I tested the change locally and confirmed the described behavior.
  • I added or updated tests for the new behavior (when applicable).
  • go build ./... and the test suite pass locally.

AI disclosure

AI was used for assistance.

  • Tools: an AI code-generation assistant.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MHSanaei/3x-ui/pull/6028 **Author:** [@mvanhorn](https://github.com/mvanhorn) **Created:** 7/18/2026 **Status:** ✅ Merged **Merged:** 7/21/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `fix/5916-vless-outbound-core-version-gate` --- ### 📝 Commits (1) - [`c9062ec`](https://github.com/MHSanaei/3x-ui/commit/c9062ec961a4be786165b28346543e29cd850e5c) fix: gate embedded unencrypted-outbound rejection on running Xray core version ### 📊 Changes **2 files changed** (+107 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `internal/web/service/xray_setting.go` (+59 -0) 📝 `internal/web/service/xray_setting_test.go` (+48 -0) </details> ### 📄 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.CheckXrayConfig` validates every outbound through the panel's compile-time embedded `xtls/xray-core` (pinned near v26.7.11), which unconditionally refuses unencrypted public outbounds. Admins who downgraded the *external* core to `26.4.25` (which accepts that config and passes `xray run -test`) still hit the panel refusal, because the check never consults which binary is actually selected. The rejection reads `infra/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 core `26.6.27`. Closes #5916 ## Type of change - [x] Bug fix - [ ] New feature - [ ] Refactoring (no behavior change) - [ ] Documentation - [ ] Tests only - [ ] Build / CI / tooling - [ ] Other ## Areas affected - [ ] Frontend (UI / panel pages) - [x] Backend (API endpoints, login, settings) - [x] Xray config generation - [ ] Subscription (share links / Clash / JSON) - [ ] Statistics / traffic counters - [ ] Database / migrations - [ ] Install / upgrade script - [ ] Docker image - [ ] Multi-node (sub-nodes) - [ ] Telegram bot ## How was this tested? `CheckXrayConfig` now reads the running external core version via the existing package process (`p.GetXrayVersion()`). Only when `xray.ValidateOutboundConfig` returns the specific "prohibited" error AND the running core parses to a version older than `26.7.11` does it skip that one outbound instead of aborting the whole save. Unknown, unparseable, or `>= 26.7.11` versions keep today's strict behavior as the safe default. `xray.ValidateOutboundConfig` itself is untouched, so the embedded rule still fires for modern cores. Added unit tests in `internal/web/service/xray_setting_test.go` for the version-gate helper and the local 3-part version comparison, including boundary cases around `26.7.11` and unknown/malformed versions. - `go build ./...` passes - `go test ./internal/web/service/...` passes - `go test ./internal/xray/...` (the embedded-validator regression test) stays green ## Screenshots / 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 - [x] I tested the change locally and confirmed the described behavior. - [x] I added or updated tests for the new behavior (when applicable). - [x] `go build ./...` and the test suite pass locally. ## AI disclosure AI was used for assistance. - Tools: an AI code-generation assistant. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:06:04 +07:00
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#6056
No description provided.