mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6268] [MERGED] fix: reject Hysteria inbound updates with empty client auth #6205
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#6205
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/6268
Author: @mvanhorn
Created: 8/19/2026
Status: ✅ Merged
Merged: 8/22/2026
Merged by: @MHSanaei
Base:
main← Head:fix/6232-hysteria-update-auth-validation📝 Commits (1)
45a46d8fix: reject Hysteria inbound updates with empty client auth📊 Changes
2 files changed (+118 additions, -0 deletions)
View changed files
📝
internal/web/service/inbound.go(+12 -0)➕
internal/web/service/inbound_hysteria_auth_test.go(+106 -0)📄 Description
Summary
Parse the clients from the pending inbound settings in
UpdateInboundand apply the existing Hysteria credential invariant before entering the persistence transaction, mirroring the rejection behavior already enforced byAddInbound. Return the establishedempty client IDvalidation error when any Hysteria client has an emptyauth, so an API-driven protocol change or edit cannot reachSyncInboundor the runtime with unusable credentials. Keep valid Hysteria auth values unchanged and do not synthesize them frompassword, mutate unrelated credentials, or add a database migration.Hysteria clients authenticate with their dedicated
authcredential, butUpdateInboundcan currently persist a Hysteria settings payload whose client has an emptyauth. That row is later rendered into the Xray configuration without a usable credential, producing authentication failures. Creation and client-specific write paths already prevent or fill this state, leaving the whole-inbound update path as the concrete gap. The fix must preserve the intentional separation between Hysteriaauthand the Trojan/Shadowsockspasswordfield rather than copying one into the other.Closes #6232
Why
Parse the clients from the pending inbound settings in
UpdateInboundand apply the existing Hysteria credential invariant before entering the persistence transaction, mirroring the rejection behavior already enforced byAddInbound. Return the establishedempty client IDvalidation error when any Hysteria client has an emptyauth, so an API-driven protocol change or edit cannot reachSyncInboundor the runtime with unusable credentials. Keep valid Hysteria auth values unchanged and do not synthesize them frompassword, mutate unrelated credentials, or add a database migration.Type of change
Areas affected
How was this tested?
Not applicable to this change.
Screenshots / recordings
No user-visible surface changes in this PR, so there is nothing to show.
Breaking changes
None. This change is additive and does not alter an existing public interface or stored format.
Checklist
go build ./...and the test suite pass locally.npm run lint,npm run typecheck, andnpm run buildpass.AI disclosure
AI was used for assistance.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.