Add setup token security for initial server setup #1121

Closed
opened 2026-04-05 18:19:24 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @adrianeastles on 8/3/2025

🛡️ Security Enhancement: Setup Token for Initial Server Setup

Problem

When spinning up a new Pangolin server, anyone in the world could potentially access the initial setup page and create the first admin account before the legitimate administrator, posing a security risk.

Solution

Implemented a setup token system that requires a secure token to be entered during the initial server setup process. The token is generated and displayed in the server console on startup until the token is used.

Initial Setup Page

  1. Navigate to http://localhost:3002/auth/initial-setup.
  2. You should see a new "Setup Token" field at the top.
  3. Enter the token from the server console.
  4. Fill in the email and password fields.
  5. Submit the form.
  6. Expected Behavior:
    • The form accepts a valid token and creates the admin.
    • The form rejects an invalid token with an error message.

Screenshots

Screenshot 2025-08-03 at 9 25 33 pm Screenshot 2025-08-03 at 9 27 23 pm Screenshot 2025-08-03 at 9 27 46 pm Screenshot 2025-08-03 at 9 28 15 pm
*Originally created by @adrianeastles on 8/3/2025* ### 🛡️ Security Enhancement: Setup Token for Initial Server Setup ### Problem When spinning up a new Pangolin server, anyone in the world could potentially access the initial setup page and create the first admin account before the legitimate administrator, posing a security risk. ### Solution Implemented a setup token system that requires a secure token to be entered during the initial server setup process. The token is generated and displayed in the server console on startup until the token is used. ### **Initial Setup Page** 1. Navigate to `http://localhost:3002/auth/initial-setup`. 2. You should see a new "Setup Token" field at the top. 3. Enter the token from the server console. 4. Fill in the email and password fields. 5. Submit the form. 6. **Expected Behavior:** * ✅ The form accepts a valid token and creates the admin. * ❌ The form rejects an invalid token with an error message. ### Screenshots <img width="828" height="162" alt="Screenshot 2025-08-03 at 9 25 33 pm" src="https://github.com/user-attachments/assets/7b2b3835-cc79-445b-b061-a93ba92e4ea0" /> <img width="460" height="657" alt="Screenshot 2025-08-03 at 9 27 23 pm" src="https://github.com/user-attachments/assets/30254493-1ca2-4d67-95ee-3df931423417" /> <img width="469" height="736" alt="Screenshot 2025-08-03 at 9 27 46 pm" src="https://github.com/user-attachments/assets/193d6fae-0362-4296-9630-f1e428a710fe" /> <img width="818" height="123" alt="Screenshot 2025-08-03 at 9 28 15 pm" src="https://github.com/user-attachments/assets/414db17f-223b-463c-ae4d-535f61827218" />
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/pangolin#1121