mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #5423] Privacy concern: IP Limit shows/logs real client IPs #3792
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#3792
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?
Originally created by @G0od102 on GitHub (Jun 17, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5423
What are you trying to do?
I noticed the small eye icon next to IP Limit shows the actual connected IP addresses for that client. Dug into how this works a bit more: enforcing IP Limit has always relied on Xray's access log being turned on, and even with the new access-log-free tracking in v3.3.1 (nice change, by the way), the panel still shows live IPs per client in the UI, and fail2ban's violation log still seems to write IP, client, and timestamp to disk whenever someone trips the limit.
On its own that's a perfectly normal anti-sharing feature. My concern is more about who actually uses this software and how.
A lot of 3x-ui installs aren't "I run this for myself." They're reseller setups: someone spins up the panel and sells VLESS/VMess/Trojan configs, and the person actually using the config never opens 3x-ui in their life. Plenty of those end users are in places where internet access is heavily restricted and there's basically no legal protection for their data. The whole point of buying a config like this is to not be tracked. They have no way of knowing that whoever controls the panel (not necessarily even the person they bought the config from, since panels and configs get resold, shared, or hacked) can see their real IP every time they connect, and that this data might just sit on disk indefinitely since there's no documented retention policy anywhere.
If a server gets seized, a panel gets compromised, or an operator is just careless, this turns from "tool that protects people from surveillance" into "logging system for the people they're trying to avoid." That's a rough failure mode for software whose whole reason for existing is getting around censorship.
What I'd actually want is for admins to be able to enforce the cap without needing to see or keep the raw IPs. Something like a "blind" mode that shows "3/2 unique IPs" and still bans over the limit through fail2ban like today, but doesn't print the literal addresses in the UI unless you click to reveal them.
Given how much this project gets used specifically to get around censorship, I think anything that surfaces real client IPs should default to private rather than the other way around.
What have you already tried?
No response
3x-ui version
v3.3.1
How did you install 3x-ui?
install.sh script
Operating system
No response
Screenshots or config snippets
Before submitting
@github-actions[bot] commented on GitHub (Jun 17, 2026):
Your description of the current behavior is accurate. Here is a precise account of what the code actually does, followed by a summary of what does and does not exist today.
What is stored and where
Client IPs are stored in two SQLite tables (confirmed in
internal/database/model/model.goandinternal/database/model/node_client_ip.go):inbound_client_ips— one row per client email, containing a JSON blob of{ip, timestamp}pairs aggregated across all cluster nodes.node_client_ip— same data attributed per node GUID, used for multi-node deployments.IPs in these tables are plaintext. There is no hashing, truncation, or anonymization anywhere in the codebase. Records are not automatically purged; they persist until an admin explicitly calls the "clear IPs" action for a specific client (
internal/web/controller/client.go:412, endpointPOST /panel/api/clients/clearIps/:email), or the client row is deleted.What is written to disk
internal/web/job/check_client_ip_job.go:516–530writes to the fail2ban input file (3xipl.log, path fromxray.GetIPLimitLogPath()) in this exact format whenever an IP is selected for banning:The comment in the source explicitly notes this format is load-bearing for the fail2ban filter regex in
x-ui.sh. This log is truncated (not rotated with retention) once per day byClearLogsJob, scheduled@dailyininternal/web/web.go:333. The banned-IP log (3xipl-banned.log) and persistent-access log (3xipl-ap.log) each keep one previous-generation copy before truncation. So the on-disk exposure window for3xipl.logis at most 24 hours; the database has no automatic expiry.What the UI exposes
The eye-icon button calls
POST /panel/api/clients/ips/:email(internal/web/controller/client.go:401), which invokesGetClientIpsWithNodes()(internal/web/service/inbound_node_ips.go:202) and returns the full plaintext IP list with timestamps and node attribution. There is no "click to reveal" gate; the IPs are returned on the first click. A separate endpoint (GET /panel/api/server/clientIps) returns all client IPs across the entire panel to authenticated users.What does not exist today
inbound_client_ipstable.internal/config/or the settings table.What you are requesting
The feature described — enforce the IP cap and write to fail2ban without persisting or displaying the literal addresses in the UI — does not exist and would require changes to both the job layer (
check_client_ip_job.go) and the API/UI. A count-only display mode for the eye icon would be a separate, smaller UI-layer change. Both are reasonable enhancement requests. If you want to contribute an implementation, the relevant files are:internal/web/job/check_client_ip_job.go— IP collection, limit enforcement, log writinginternal/web/service/inbound_node_ips.goandinternal/web/service/inbound_client_ips.go— storage and retrievalinternal/web/controller/client.go— API endpointsfrontend/src/pages/clients/ClientFormModal.tsx— eye-icon display logicThis reply was generated automatically; a maintainer may follow up.