[PR #4423] [CLOSED] fix(inbounds): prevent search from matching raw JSON field names in settings/streamSettings #5684

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

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/4423
Author: @abdalrahmanx9
Created: 5/16/2026
Status: ❌ Closed

Base: main ← Head: fix/inbound-search-json-keys


📝 Commits (1)

  • 5457194 fix(inbounds): prevent search from matching raw JSON field names in settings/streamSettings

📊 Changes

1 file changed (+17 additions, -6 deletions)

View changed files

📝 frontend/src/pages/inbounds/InboundList.vue (+17 -6)

📄 Description

Summary

The inbound search uses deepSearch() on the entire DBInbound object, which includes raw JSON strings (settings, streamSettings, sniffing). The function searches these as plain text, so internal JSON property names like "echForceQuery" case-insensitively match search terms like "for", causing unrelated inbounds to appear in results. When those inbounds are expanded, they show empty clients because no client matches the search term.

Root Cause

deepSearch(dbInbound, searchKey) in InboundList.vue recursively traverses all properties including streamSettings (a raw JSON string). "echForceQuery" contains For which lowercases to for, producing a false positive.

Fix

Replace the inbound-level deepSearch with targeted field checks:

  • Inbound metadata: remark, tag, listen, protocol, port
  • Client data: parsed from settings.clients JSON (email, UUID, comment, subId, etc.)
  • Excluded: raw JSON string fields (settings, streamSettings, sniffing)

When a client match is found only matching clients are shown. When the match is in inbound metadata only, all clients are shown.

Before

Searching "for" shows inbounds with echForceQuery in their streamSettings — expanded with zero clients.

After

Searching "for" shows only inbounds whose metadata or clients actually contain "for".


🔄 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/4423 **Author:** [@abdalrahmanx9](https://github.com/abdalrahmanx9) **Created:** 5/16/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/inbound-search-json-keys` --- ### 📝 Commits (1) - [`5457194`](https://github.com/MHSanaei/3x-ui/commit/54571944bb3839a24fbae6c96ea8bc2eb7254f08) fix(inbounds): prevent search from matching raw JSON field names in settings/streamSettings ### 📊 Changes **1 file changed** (+17 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `frontend/src/pages/inbounds/InboundList.vue` (+17 -6) </details> ### 📄 Description ## Summary The inbound search uses deepSearch() on the entire DBInbound object, which includes raw JSON strings (settings, streamSettings, sniffing). The function searches these as plain text, so internal JSON property names like `"echForceQuery"` case-insensitively match search terms like "for", causing unrelated inbounds to appear in results. When those inbounds are expanded, they show empty clients because no client matches the search term. ## Root Cause `deepSearch(dbInbound, searchKey)` in InboundList.vue recursively traverses all properties including streamSettings (a raw JSON string). `"echForceQuery"` contains `For` which lowercases to `for`, producing a false positive. ## Fix Replace the inbound-level `deepSearch` with targeted field checks: - **Inbound metadata**: `remark`, `tag`, `listen`, `protocol`, `port` - **Client data**: parsed from `settings.clients` JSON (email, UUID, comment, subId, etc.) - **Excluded**: raw JSON string fields (`settings`, `streamSettings`, `sniffing`) When a client match is found only matching clients are shown. When the match is in inbound metadata only, all clients are shown. ## Before Searching "for" shows inbounds with `echForceQuery` in their streamSettings — expanded with zero clients. ## After Searching "for" shows only inbounds whose metadata or clients actually contain "for". --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:03:19 +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#5684
No description provided.