[GH-ISSUE #5423] Privacy concern: IP Limit shows/logs real client IPs #3792

Closed
opened 2026-10-31 20:34:59 +07:00 by bsakaguchi · 1 comment
Owner

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

Image

Before submitting

  • I read the Wiki and searched existing issues.
  • This is a usage question, not a bug report.
  • This question is written in English.
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 <img width="1400" height="851" alt="Image" src="https://github.com/user-attachments/assets/d7a28c63-09e2-487d-ad50-7625b1f84faa" /> ### Before submitting - [x] I read the [Wiki](https://github.com/MHSanaei/3x-ui/wiki) and searched [existing issues](../issues?q=is%3Aissue). - [x] This is a usage question, not a bug report. - [x] This question is written in English.
Author
Owner

@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.go and internal/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, endpoint POST /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–530 writes to the fail2ban input file (3xipl.log, path from xray.GetIPLimitLogPath()) in this exact format whenever an IP is selected for banning:

[LIMIT_IP] Email = <clientEmail> || Disconnecting OLD IP = <ip> || Timestamp = <unix>

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 by ClearLogsJob, scheduled @daily in internal/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 for 3xipl.log is 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 invokes GetClientIpsWithNodes() (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

  • No IP masking, hashing, or partial-display option.
  • No configurable retention period for the inbound_client_ips table.
  • No "blind count" mode that enforces the limit without storing or displaying raw addresses.
  • No access-control granularity within the panel (any authenticated user sees all client IPs).
  • No privacy-related setting in 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 writing
  • internal/web/service/inbound_node_ips.go and internal/web/service/inbound_client_ips.go — storage and retrieval
  • internal/web/controller/client.go — API endpoints
  • frontend/src/pages/clients/ClientFormModal.tsx — eye-icon display logic

This reply was generated automatically; a maintainer may follow up.

<!-- gh-comment-id:4735749706 --> @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.go` and `internal/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`, endpoint `POST /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–530` writes to the fail2ban input file (`3xipl.log`, path from `xray.GetIPLimitLogPath()`) in this exact format whenever an IP is selected for banning: ``` [LIMIT_IP] Email = <clientEmail> || Disconnecting OLD IP = <ip> || Timestamp = <unix> ``` 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 by `ClearLogsJob`, scheduled `@daily` in `internal/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 for `3xipl.log` is 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 invokes `GetClientIpsWithNodes()` (`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** - No IP masking, hashing, or partial-display option. - No configurable retention period for the `inbound_client_ips` table. - No "blind count" mode that enforces the limit without storing or displaying raw addresses. - No access-control granularity within the panel (any authenticated user sees all client IPs). - No privacy-related setting in `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 writing - `internal/web/service/inbound_node_ips.go` and `internal/web/service/inbound_client_ips.go` — storage and retrieval - `internal/web/controller/client.go` — API endpoints - `frontend/src/pages/clients/ClientFormModal.tsx` — eye-icon display logic *This reply was generated automatically; a maintainer may follow up.*
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#3792
No description provided.