Security Model

Security depends on how you run DBO Studio. A desktop app on your laptop is not the same as a container on the public internet.

Trust model

How you run itAssumptionIf the port is on a network
Desktop, or local web with no loginThe person at the keyboard owns the machineLow locally. Do not expose the port.
Web with login (local auth)Each user has an account; connections belong to that userMedium on a LAN. Use TLS on the internet.
Public server without loginAnyone who can hit the portHigh. Turn login on and terminate TLS.

Without login (APP_AUTH_MODE=none), every browser that reaches the port gets full access. That is intended for your own machine only.

The desktop app never shows login. The owner is always "desktop".

Warning: Publishing port 9000 on 0.0.0.0 without login makes a public database client that anyone can use. Set APP_AUTH_MODE=local before you expose it. See Authentication and users.

Login

When APP_AUTH_MODE=local (setup steps are in Authentication and users):

  1. Users sign in with email and password. The API sets an HttpOnly dbo_session cookie.
  2. Almost every /api/* route requires that session. Sign-in, first-run setup, and the health check are the exceptions.
  3. CORS allows only APP_ALLOWED_ORIGINS. Localhost is not auto-trusted in this mode.
  • Name dbo_session, HttpOnly, SameSite=Lax
  • Secure when the public URL is HTTPS
  • Idle timeout 24 hours, absolute lifetime 7 days
  • Logout deletes the server row; login and password change rotate the session
  • A database error during session lookup returns 500 — it does not mint a new owner

First admin

With login on and no account yet, the admin is created on a setup screen that needs a random token. DBO Studio prints the token at startup, to its output and log, so only someone with access to the server can use it. The token is checked in constant time, works once, and is replaced on restart. The setup endpoint refuses once any account exists. You can also create the admin from APP_ADMIN_EMAIL and APP_ADMIN_PASSWORD.

Passwords are 8 to 40 characters with a letter and a number. They are stored as bcrypt hashes and never logged.

Turning login off

APP_AUTH_MODE=none with existing accounts makes every browser act as the first admin, including that admin's saved database passwords. Only do this on a host no one else can reach.

Roles and two-factor sign-in

Accounts are admin or member, with per-member permissions for creating connections, AI settings, and MCP. Users can turn on two-factor sign-in with an authenticator app. See Authentication and users.

DBO Studio does not implement SQL GRANT. Restrict what a database user can do in the engine itself, and use Safe Mode against mistakes.

Single sign-on (OIDC), LDAP, and proxy header authentication are not available.

Safe Mode

Safe Mode adds a confirmation or a separate password before queries run on a connection. The check runs on the server for the editor, grid edits, schema forms, and agent writes. See Safe Mode.

Secrets at rest

Connection passwords are encrypted with AES-GCM. The key file is created mode 0600, either at APP_SECRET_KEY_PATH or under the app data directory.

Passwords never appear in API responses or logs.

AI provider keys are encrypted when that key file exists. If encryption fails, the update is rejected rather than stored as plaintext.

Shared connections

On a server with login, an admin can share a connection card (host, port, database, SSL, name) with other DBO users.

Catalog roles viewer and editor control who can use or edit the card. They are not SQL read-only, and they do not replace database GRANT.

By default each user types their own database password. The admin may also share a remembered password. Anyone who can read both the data volume and app_secret.key can decrypt that vault — treat it as a blast-radius choice.

The desktop app does not share connections.

MCP tokens

MCP access uses hashed tokens in the app database, compared in constant time. Configure MCP in Settings → AI. The public URL must match APP_PUBLIC_URL or APP_MCP_PUBLIC_URL from Configuration.

SQL and exports

  • Guarded paths classify statements as read or write before they run
  • Safe Mode blocks writes when it is on
  • Grid filters and sorts use an allow-list of operators and quoted identifiers
  • Web exports cannot write outside the exports/ directory
  • MCP execute is read-only AST validation with injected limits
  • Job result downloads refuse paths outside that export directory

Logs

Fetching logs requires a valid session. In local mode that means the caller already signed in.

Hardening checklist

Use this before you put DBO on the internet:

  • TLS at the reverse proxy
  • APP_AUTH_MODE=local, with the admin account created
  • APP_PUBLIC_URL matches the public origin
  • APP_ALLOWED_ORIGINS lists only trusted frontends
  • Data volume backed up (dbo.db, app_secret.key)
  • Safe Mode on if operators share the instance
  • Database servers accept connections only from known hosts
  • Shared-password vault off unless the team truly needs one database identity

Reporting issues

Send a minimal reproduction. Never include live credentials or production tokens.

Previous

Configuration Reference

Next

Getting Started with Local Development