[GH-ISSUE #6253] [Bug]: Panel-to-Panel Reverse connection triggers Telegram login notifications #4243

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

Originally created by @Mo7amadd on GitHub (Aug 18, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6253

Describe the bug

When Telegram login notifications are enabled on Panel A, establishing a Panel-to-Panel Reverse connection from Panel B triggers a Telegram Login successful notification.

For example:

Panel A has Telegram bot/login notifications enabled.
Panel B connects to Panel A using Panel-to-Panel Reverse.
Panel A sends a normal Login successful Telegram notification for the authentication from Panel B.

This is misleading because the authentication is generated by the internal Panel-to-Panel Reverse connection, not by an administrator logging into the web panel.

The notification may also be triggered again during reverse reconnect attempts when the connection is interrupted or unavailable.

How to reproduce the problem

Configure Telegram bot notifications on Panel A.
Enable Login Notification on Panel A.
Configure Panel B to connect to Panel A using Panel-to-Panel Reverse.
Start the reverse connection.
Check Telegram notifications from Panel A.

A Login successful notification is generated for the Panel-to-Panel Reverse authentication.

If the reverse connection is interrupted and reconnect attempts occur, additional login notifications may also be generated.

Expected behavior

Panel-to-Panel Reverse authentication should not trigger normal Telegram panel login notifications.

Login notifications should only be sent for actual administrator/user logins to the web panel.

Internal Panel-to-Panel Reverse authentication or reconnect requests should either be excluded from login notifications or use a separate notification type.

Actual behavior

Panel-to-Panel Reverse authentication is treated as a normal panel login and generates Telegram Login successful notifications.

Relevant logs


Screenshots

No response

3x-ui version

dev+380aff4d

Xray-core version

No response

How did you install 3x-ui?

install.sh script

Operating system

Ubuntu 24.04

Which parts of the panel are affected?

No response

Browser (only if it is a UI bug)

No response

Is the panel behind a reverse proxy or CDN?

None

Before submitting

  • I searched existing issues and this bug has not been reported.
  • I am running the latest released version of 3x-ui (or have verified the bug still exists on it).
  • This bug report is written in English.
  • I have redacted any sensitive data (tokens, real domains, client UUIDs).
Originally created by @Mo7amadd on GitHub (Aug 18, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6253 ### Describe the bug When Telegram login notifications are enabled on Panel A, establishing a Panel-to-Panel Reverse connection from Panel B triggers a Telegram Login successful notification. For example: Panel A has Telegram bot/login notifications enabled. Panel B connects to Panel A using Panel-to-Panel Reverse. Panel A sends a normal Login successful Telegram notification for the authentication from Panel B. This is misleading because the authentication is generated by the internal Panel-to-Panel Reverse connection, not by an administrator logging into the web panel. The notification may also be triggered again during reverse reconnect attempts when the connection is interrupted or unavailable. ### How to reproduce the problem Configure Telegram bot notifications on Panel A. Enable Login Notification on Panel A. Configure Panel B to connect to Panel A using Panel-to-Panel Reverse. Start the reverse connection. Check Telegram notifications from Panel A. A Login successful notification is generated for the Panel-to-Panel Reverse authentication. If the reverse connection is interrupted and reconnect attempts occur, additional login notifications may also be generated. ### Expected behavior Panel-to-Panel Reverse authentication should not trigger normal Telegram panel login notifications. Login notifications should only be sent for actual administrator/user logins to the web panel. Internal Panel-to-Panel Reverse authentication or reconnect requests should either be excluded from login notifications or use a separate notification type. ### Actual behavior Panel-to-Panel Reverse authentication is treated as a normal panel login and generates Telegram Login successful notifications. ### Relevant logs ```shell ``` ### Screenshots _No response_ ### 3x-ui version dev+380aff4d ### Xray-core version _No response_ ### How did you install 3x-ui? install.sh script ### Operating system Ubuntu 24.04 ### Which parts of the panel are affected? _No response_ ### Browser (only if it is a UI bug) _No response_ ### Is the panel behind a reverse proxy or CDN? None ### Before submitting - [x] I searched [existing issues](../issues?q=is%3Aissue) and this bug has not been reported. - [x] I am running the latest released version of 3x-ui (or have verified the bug still exists on it). - [x] This bug report is written in English. - [x] I have redacted any sensitive data (tokens, real domains, client UUIDs).
bsakaguchi 2026-10-31 20:38:15 +07:00
Author
Owner

@github-actions[bot] commented on GitHub (Aug 18, 2026):

I could not reproduce this path in the source: there is no code in the panel where a reverse connection authenticates against the login handler. The "Logged in to the panel successfully" Telegram message has exactly one producer, a successful POST /login with valid credentials.

The chain I traced on the current main (the commit you are running, 380aff4):

  • internal/web/controller/index.go:117 is the only UserLoginNotify(..., Status: tgbot.LoginSuccess) call, and it is reached only after a.userService.CheckUser(...) returns a user (index.go:95).
  • internal/web/service/tgbot/tgbot_report.go:180 publishes the login.attempt event.
  • internal/web/service/tgbot/tgbot_event.go:138-147 renders tgbot.messages.loginSuccess, i.e. the message you received.
  • POST /login is registered once, at internal/web/controller/index.go:46, and nothing in the repository calls it; the only caller is the browser login form (frontend/src/pages/login/LoginPage.tsx:81).

Two things that rule out the mechanisms one would suspect first:

  • The panel's reverse support is Xray's VLESS simple reverse proxy — a client-level reverse.tag (internal/database/model/model.go:868-878, persisted in internal/web/service/client_crud.go:570-580) plus a matching settings.reverseTag on the VLESS outbound. It is carried entirely in the generated Xray config and never reaches the panel's HTTP router, so it cannot invoke the login handler.
  • Multi-node sync never uses /login either: the master authenticates with a bearer API token or an mTLS client certificate (internal/web/runtime/remote.go:232-237, verified in internal/web/controller/api.go:37-62), so node heartbeats and reconnects cannot emit login notifications.

That means something is performing a genuine credentialed login against Panel A's web panel, and it is worth identifying rather than filtering out. To narrow it down, please provide:

  1. The Username and IP lines from the Telegram message on Panel A (the template includes both, tgbot_event.go:143-144). Whether the IP is Panel B's address decides where to look next.
  2. Panel A's log for the same timestamp, from x-ui log on the server. Every successful login also writes <username> logged in successfully, Ip Address: <ip> at internal/web/controller/index.go:116. If that line is present, a real login request arrived; if the Telegram message appears without it, that is a different defect and useful to know.
  3. How the reverse link is configured on both sides — the client "Reverse tag" field plus a VLESS outbound carrying the same tag, or something else (an entry under Nodes, or a third-party script or manager). Several third-party 3x-ui tools authenticate by posting the panel username and password to /login and re-authenticate on every reconnect, which would match the pattern you describe, including the repeat notifications on reconnect.

As an interim measure, login notifications can be switched off in Panel Settings, Telegram tab, "Security" group, "Login attempt" toggle. It writes the tgEnabledEvents setting (default login.attempt,cpu.high, internal/web/service/setting.go:157) and is all-or-nothing, so it also suppresses failed-login alerts.

Certainty: the notification chain above is confirmed in the source at the lines given; the reverse-triggered path is what I could not confirm, which is why the details above are needed.

This reply was generated automatically. A maintainer may follow up.

<!-- gh-comment-id:5329584269 --> @github-actions[bot] commented on GitHub (Aug 18, 2026): I could not reproduce this path in the source: there is no code in the panel where a reverse connection authenticates against the login handler. The "Logged in to the panel successfully" Telegram message has exactly one producer, a successful `POST /login` with valid credentials. The chain I traced on the current `main` (the commit you are running, `380aff4`): - `internal/web/controller/index.go:117` is the only `UserLoginNotify(..., Status: tgbot.LoginSuccess)` call, and it is reached only after `a.userService.CheckUser(...)` returns a user (`index.go:95`). - `internal/web/service/tgbot/tgbot_report.go:180` publishes the `login.attempt` event. - `internal/web/service/tgbot/tgbot_event.go:138-147` renders `tgbot.messages.loginSuccess`, i.e. the message you received. - `POST /login` is registered once, at `internal/web/controller/index.go:46`, and nothing in the repository calls it; the only caller is the browser login form (`frontend/src/pages/login/LoginPage.tsx:81`). Two things that rule out the mechanisms one would suspect first: - The panel's reverse support is Xray's VLESS simple reverse proxy — a client-level `reverse.tag` (`internal/database/model/model.go:868-878`, persisted in `internal/web/service/client_crud.go:570-580`) plus a matching `settings.reverseTag` on the VLESS outbound. It is carried entirely in the generated Xray config and never reaches the panel's HTTP router, so it cannot invoke the login handler. - Multi-node sync never uses `/login` either: the master authenticates with a bearer API token or an mTLS client certificate (`internal/web/runtime/remote.go:232-237`, verified in `internal/web/controller/api.go:37-62`), so node heartbeats and reconnects cannot emit login notifications. That means something is performing a genuine credentialed login against Panel A's web panel, and it is worth identifying rather than filtering out. To narrow it down, please provide: 1. The `Username` and `IP` lines from the Telegram message on Panel A (the template includes both, `tgbot_event.go:143-144`). Whether the IP is Panel B's address decides where to look next. 2. Panel A's log for the same timestamp, from `x-ui log` on the server. Every successful login also writes `<username> logged in successfully, Ip Address: <ip>` at `internal/web/controller/index.go:116`. If that line is present, a real login request arrived; if the Telegram message appears without it, that is a different defect and useful to know. 3. How the reverse link is configured on both sides — the client "Reverse tag" field plus a VLESS outbound carrying the same tag, or something else (an entry under Nodes, or a third-party script or manager). Several third-party 3x-ui tools authenticate by posting the panel username and password to `/login` and re-authenticate on every reconnect, which would match the pattern you describe, including the repeat notifications on reconnect. As an interim measure, login notifications can be switched off in Panel Settings, Telegram tab, "Security" group, "Login attempt" toggle. It writes the `tgEnabledEvents` setting (default `login.attempt,cpu.high`, `internal/web/service/setting.go:157`) and is all-or-nothing, so it also suppresses failed-login alerts. Certainty: the notification chain above is confirmed in the source at the lines given; the reverse-triggered path is what I could not confirm, which is why the details above are needed. *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#4243
No description provided.