Skip to content

Security: First user can register as admin without authentication on fresh deployment #81

Description

@keldian

Summary

By default, when Scrob is deployed to the web, the first visitor can immediately register an account and become the admin without any authentication or gating mechanism. This is a significant security risk for users who are unaware of this behavior during initial setup.

Current Behavior

According to the configuration documentation:

The first user can always register regardless of this setting.

This means:

  • ENABLE_REGISTRATIONS=true (default) allows anyone to register
  • Even if ENABLE_REGISTRATIONS=false, the first user can still register
  • There's no setup wizard, initial token requirement, or other protective mechanism
  • On first visit to a publicly accessible instance, anyone can claim the admin account

Risk Scenario

  1. User deploys Scrob to a public URL (e.g., scrob.example.com)
  2. URL becomes immediately accessible
  3. Before the admin can visit and register themselves, a malicious actor visits first
  4. Malicious actor registers as admin and gains full control of the instance
  5. Legitimate admin is locked out or must delete the malicious account via database access

Why This Is Bad Design

This assumes deployment in a trusted environment where initial access is controlled. But in practice:

  • Platforms like Railway, Render, Vercel make URLs instantly public
  • Users may not read security documentation during setup
  • The default behavior should be secure; security shouldn't rely on the operator remembering to configure it

Suggested Mitigations

  1. Require an initial setup token/password before any registration (one-time use)
  2. Default to ENABLE_REGISTRATIONS: false — require explicit opt-in for public registration
  3. Implement a setup wizard that must be completed before the instance is usable (similar to Nextcloud, Immich, Jellyfin)

Workarounds (Current)

Users can currently protect themselves by:

  • Setting up OIDC/SSO with OIDC_DISABLE_PASSWORD_LOGIN=true before deploying publicly
  • Keeping the instance on a private network until admin setup is complete

But these require security awareness that many users lack during initial deployment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions