[PR #4043] [CLOSED] security: fix password log leak, getDb CSRF, cookie hardening #5585

Closed
opened 2026-10-31 20:47:59 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/4043
Author: @snvv133
Created: 4/19/2026
Status: ❌ Closed

Base: main ← Head: security-fixes


📝 Commits (1)

  • 3c11977 security: fix password log leak, getDb CSRF, cookie hardening

📊 Changes

4 files changed (+36 additions, -7 deletions)

View changed files

📝 web/controller/index.go (+2 -3)
📝 web/controller/server.go (+7 -1)
📝 web/html/index.html (+22 -2)
📝 web/web.go (+5 -1)

📄 Description

  1. web/controller/index.go Stop logging the submitted plaintext password on failed login. Replace it with "***" in the Telegram notification too.

  2. web/controller/server.go + web/html/index.html Convert /panel/api/server/getDb from GET to POST and require an X-Requested-With header. Prevents //

    CSRF that would otherwise let an attacker steal the SQLite DB by tricking a logged-in admin into loading a single URL.

  3. web/web.go Set Secure=true on the session cookie when TLS cert/key are configured, and tighten SameSite from Lax to Strict for the panel session.

What is the pull request?

Which part of the application is affected by the change?

  • Frontend
  • Backend

Type of Changes

  • Bug fix
  • New feature
  • Refactoring
  • Other

Screenshots


🔄 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/4043 **Author:** [@snvv133](https://github.com/snvv133) **Created:** 4/19/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `security-fixes` --- ### 📝 Commits (1) - [`3c11977`](https://github.com/MHSanaei/3x-ui/commit/3c11977c772683e5e90234ed1f0b1073513391c7) security: fix password log leak, getDb CSRF, cookie hardening ### 📊 Changes **4 files changed** (+36 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `web/controller/index.go` (+2 -3) 📝 `web/controller/server.go` (+7 -1) 📝 `web/html/index.html` (+22 -2) 📝 `web/web.go` (+5 -1) </details> ### 📄 Description 1. web/controller/index.go Stop logging the submitted plaintext password on failed login. Replace it with "***" in the Telegram notification too. 2. web/controller/server.go + web/html/index.html Convert /panel/api/server/getDb from GET to POST and require an X-Requested-With header. Prevents <img>/<a>/<form> CSRF that would otherwise let an attacker steal the SQLite DB by tricking a logged-in admin into loading a single URL. 3. web/web.go Set Secure=true on the session cookie when TLS cert/key are configured, and tighten SameSite from Lax to Strict for the panel session. ## What is the pull request? <!-- Briefly describe the changes introduced by this pull request --> ## Which part of the application is affected by the change? - [ ] Frontend - [ ] Backend ## Type of Changes - [ ] Bug fix - [ ] New feature - [ ] Refactoring - [ ] Other ## Screenshots <!-- Add screenshots to illustrate the changes --> <!-- Remove this section if it is not applicable. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 20:47:59 +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#5585
No description provided.