[PR #4275] [MERGED] Security hardening: sessions, SSRF, CSP nonce, CSRF logout, trusted proxies #5641

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

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/4275
Author: @farhadh
Created: 5/11/2026
Status: ✅ Merged
Merged: 5/13/2026
Merged by: @MHSanaei

Base: main ← Head: fix/farhadh/security-hardening-2


📝 Commits (10+)

  • ce88b0b refactor(session): store user ID in session instead of full struct
  • 56ce607 feat(auth): block panel with default admin/admin credentials and guide credential change
  • a6a4ffb feat(settings): redact secrets in AllSettingView and add TrustedProxyCIDRs
  • 5ffd896 fix(security): SSRF prevention, trusted-proxy header gating, CSP nonce, HTTP timeouts
  • 6343c43 feat(nodes): add allow-private-address toggle per node
  • 11629fb chore: frontend UX improvements, CI pipeline, and dev tooling
  • 5550207 fix(ci): stub web/dist before go list to satisfy go:embed at compile time
  • d8e05c1 chore(ui): remove health-strip bar from dashboard top
  • 11db4f0 Merge branch 'main' into fix/farhadh/security-hardening-2
  • d028d39 Revert "feat(auth): block panel with default admin/admin credentials and guide credential change"

📊 Changes

40 files changed (+966 additions, -161 deletions)

View changed files

📝 .github/dependabot.yml (+8 -0)
➕ .github/workflows/ci.yml (+63 -0)
➕ .nvmrc (+1 -0)
📝 database/model/model.go (+17 -24)
📝 frontend/package-lock.json (+4 -0)
📝 frontend/package.json (+4 -0)
📝 frontend/src/api/axios-init.js (+10 -21)
📝 frontend/src/components/AppSidebar.vue (+8 -2)
📝 frontend/src/models/setting.js (+8 -1)
📝 frontend/src/pages/api-docs/endpoints.js (+5 -4)
📝 frontend/src/pages/inbounds/InboundList.vue (+68 -7)
📝 frontend/src/pages/nodes/NodeFormModal.vue (+7 -0)
📝 frontend/src/pages/settings/GeneralTab.vue (+13 -1)
📝 frontend/src/pages/settings/SecurityTab.vue (+3 -4)
📝 frontend/src/pages/settings/TelegramTab.vue (+5 -2)
📝 frontend/src/pages/settings/TwoFactorModal.vue (+8 -2)
📝 frontend/src/pages/sub/SubPage.vue (+0 -1)
📝 frontend/src/pages/xray/DnsPresetsModal.vue (+1 -1)
📝 web/controller/api.go (+6 -16)
📝 web/controller/dist.go (+5 -1)

...and 20 more files

📄 Description

What is the pull request?

  • Store user ID in session, reload from DB
  • Forced credential change - middleware + UX
  • Secrets redaction, TrustedProxyCIDRs, /secret endpoint
  • SSRF prevention, trusted proxies, CSP nonce, HTTP timeouts
  • Allow-private-address toggle for private-LAN nodes
  • InboundList filter persistence, health strip, CI, .nvmrc

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/4275 **Author:** [@farhadh](https://github.com/farhadh) **Created:** 5/11/2026 **Status:** ✅ Merged **Merged:** 5/13/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `fix/farhadh/security-hardening-2` --- ### 📝 Commits (10+) - [`ce88b0b`](https://github.com/MHSanaei/3x-ui/commit/ce88b0b432736f94f5ad00c37e77d21a54752ee0) refactor(session): store user ID in session instead of full struct - [`56ce607`](https://github.com/MHSanaei/3x-ui/commit/56ce6073ce09f08147f989858e0e88b3a4359546) feat(auth): block panel with default admin/admin credentials and guide credential change - [`a6a4ffb`](https://github.com/MHSanaei/3x-ui/commit/a6a4ffbeab2f8ad4fe265e511fa811f3c3a922a1) feat(settings): redact secrets in AllSettingView and add TrustedProxyCIDRs - [`5ffd896`](https://github.com/MHSanaei/3x-ui/commit/5ffd896a7ce6bbcfc2dd5e22133d6116ce7824ac) fix(security): SSRF prevention, trusted-proxy header gating, CSP nonce, HTTP timeouts - [`6343c43`](https://github.com/MHSanaei/3x-ui/commit/6343c43f628db9d366890dd2b002d42e32bd3d8e) feat(nodes): add allow-private-address toggle per node - [`11629fb`](https://github.com/MHSanaei/3x-ui/commit/11629fba807e956ae890212355e47f86f6b18910) chore: frontend UX improvements, CI pipeline, and dev tooling - [`5550207`](https://github.com/MHSanaei/3x-ui/commit/55502070e6c10b996d8432599ebde751fd444ba0) fix(ci): stub web/dist before go list to satisfy go:embed at compile time - [`d8e05c1`](https://github.com/MHSanaei/3x-ui/commit/d8e05c12a644094ccb9175a75a98055f1a8468bd) chore(ui): remove health-strip bar from dashboard top - [`11db4f0`](https://github.com/MHSanaei/3x-ui/commit/11db4f0d297681f13bd4ff80fec5428bf48fe1ad) Merge branch 'main' into fix/farhadh/security-hardening-2 - [`d028d39`](https://github.com/MHSanaei/3x-ui/commit/d028d390ebe773988921d22c444f7f5ccc26fd75) Revert "feat(auth): block panel with default admin/admin credentials and guide credential change" ### 📊 Changes **40 files changed** (+966 additions, -161 deletions) <details> <summary>View changed files</summary> 📝 `.github/dependabot.yml` (+8 -0) ➕ `.github/workflows/ci.yml` (+63 -0) ➕ `.nvmrc` (+1 -0) 📝 `database/model/model.go` (+17 -24) 📝 `frontend/package-lock.json` (+4 -0) 📝 `frontend/package.json` (+4 -0) 📝 `frontend/src/api/axios-init.js` (+10 -21) 📝 `frontend/src/components/AppSidebar.vue` (+8 -2) 📝 `frontend/src/models/setting.js` (+8 -1) 📝 `frontend/src/pages/api-docs/endpoints.js` (+5 -4) 📝 `frontend/src/pages/inbounds/InboundList.vue` (+68 -7) 📝 `frontend/src/pages/nodes/NodeFormModal.vue` (+7 -0) 📝 `frontend/src/pages/settings/GeneralTab.vue` (+13 -1) 📝 `frontend/src/pages/settings/SecurityTab.vue` (+3 -4) 📝 `frontend/src/pages/settings/TelegramTab.vue` (+5 -2) 📝 `frontend/src/pages/settings/TwoFactorModal.vue` (+8 -2) 📝 `frontend/src/pages/sub/SubPage.vue` (+0 -1) 📝 `frontend/src/pages/xray/DnsPresetsModal.vue` (+1 -1) 📝 `web/controller/api.go` (+6 -16) 📝 `web/controller/dist.go` (+5 -1) _...and 20 more files_ </details> ### 📄 Description ## What is the pull request? - Store user ID in session, reload from DB - Forced credential change - middleware + UX - Secrets redaction, TrustedProxyCIDRs, /secret endpoint - SSRF prevention, trusted proxies, CSP nonce, HTTP timeouts - Allow-private-address toggle for private-LAN nodes - InboundList filter persistence, health strip, CI, .nvmrc ## Which part of the application is affected by the change? - [x] Frontend - [x] Backend ## Type of Changes - [x] Bug fix - [x] New feature - [x] 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:48:20 +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#5641
No description provided.