Security model

A database tool asks for the keys. Here is what it does with them.

Every database client is a trusted piece of software: you hand it a credential and it runs whatever you tell it to. DB Desk is no different, so the honest question is not "is it trustworthy" but what can you check yourself. This page answers that, with measurements you can repeat.

Local-first, with no DB Desk backend

There is no account and no server of ours in the path. A sidecar process on your machine serves the UI and talks to your databases.

Read-only is the default

New connections start read-only, and the check lives in the API the UI calls — hiding a button is not the protection.

A production write needs an approval

Approvals are single-use and bound to the hash of the exact statement. A different statement, or the same one twice, is rejected.

Credentials never leave the machine

Encrypted at rest with AES-256-GCM, decrypted only to open a connection, and never part of an AI request.

What actually leaves your machine

DB Desk talks to two kinds of things: your database, and — only if you configure them — your AI endpoint and the signed updater. Everything else is in-process.

What you doOutbound network
Open the app, browse the tree, view tablesnone
Run a query, edit a row, export CSVnone
Save or edit a connectionnone
Use AI (only after you add a key)your endpoint — api.openai.com, your gateway, or Ollama on 127.0.0.1
Check for updatesgithub.com (release manifest, signature verified)
Measured, not claimed. Against build 0.13.12, a session that created a connection, opened the orders table, ran an aggregate query and opened Settings made 35 HTTP requests — all of them to 127.0.0.1 — and the backend process held no outbound TCP connection at any point.

Repeat it yourself

The repository ships the harness used for that measurement. It drives the real UI and prints every host contacted, plus the backend's TCP peers:

python scripts/egress-check.py http://127.0.0.1:8930

If you would rather not trust the harness, run the app with your network monitor of choice, or pull the cable: browsing and querying keep working.

Defaults that limit the blast radius

GuardWhat it does
Read-only connectionOnly SELECT, WITH, SHOW, DESCRIBE, EXPLAIN, TABLE and VALUES reach the server. Enforced in the backend, per connection.
Statement limits30-second statement timeout and a 1000-row cap on results, so a stray query cannot pin your database or flood the app.
Production approvalA connection marked as production refuses writes with 403 approval_required until an approval exists for that exact SQL hash, and each approval is consumed once.
Audit logStatements are appended to a local JSONL log — what ran, on which connection, when — readable from the app.

None of this is a sandbox. Read-only is a guardrail against the wrong tab in the wrong window; the real defence is the database user you hand to the app.

The strongest thing you can do

Give DB Desk a database user that cannot write. A GRANT SELECT-only role makes every guardrail above redundant, and the app works normally — read-only mode is a supported way to run it, not a degraded one.

Where your credentials live

  • Connections are stored in connections.json in the app's data folder, mode 0600, owned by your user.
  • Passwords and keys are encrypted with AES-256-GCM under a vault key that also sits in that folder, mode 0600. They are decrypted only when a connection is opened.
  • Secrets are excluded from logs, from exports, and from AI payloads — the test suite asserts that a saved password never appears in an AI request.
  • Windows on ARM stores the vault with pycryptodome instead of OpenSSL-backed cryptography; the wire format is identical (pinned byte-for-byte by a test), so a vault moves between platforms.

The AI boundary

AI is optional and off until you add a key. When it is on, the payload is built from allowlists rather than from connection records:

  • Table and column names, types, your question and the current SQL — no rows, no result sets, no passwords, no tokens, no SSH material, no headers.
  • Autocomplete is a toggle in Settings; when it is off the server refuses those requests instead of trusting the UI to stay quiet.
  • Point the base URL at Ollama or LM Studio on 127.0.0.1 and nothing leaves the machine at all.

Release integrity

ControlState
Signed updateson the updater verifies a minisign signature before installing; the public key is pinned in the app
Checksums per releaseon SHA256SUMS.txt is published with every release
Public, auditable sourceon MIT-licensed; the CI that builds the binaries is the CI in the repository
CI gates on every pushon full test suite, plugin-drift check, CodeQL, dependency audit
macOS notarisationwhen secrets are present signed and notarised builds use the Apple Developer identity
Windows code signingpending installers are not yet signed, so SmartScreen may warn — compare the SHA-256 against the release
Signed checksumson SHA256SUMS.txt carries a keyless Sigstore signature; verifying it names this repository's release workflow, not a key we hold
Build provenanceon every asset has a GitHub attestation — gh attestation verify <file> --repo wzul/dbdesk-app

We list the gaps on purpose. A security page that only lists wins is a marketing page.

Hosting the server mode

The desktop app is not the only shape: DBDESK_SERVER=1 turns the same build into a single-tenant web app on your own machine or VPS. That mode adds a login (scrypt-hashed password, server-side sessions, CSRF tokens, and a per-address throttle that returns 429 after ten failures in fifteen minutes) and gates the features that only make sense locally, such as SSH tunnels and local file paths.

It is yours to run. We do not host your databases, and there is no multi-tenant service where your credentials would sit next to someone else's.

Reporting a vulnerability

Please use GitHub's private advisory form:

github.com/wzul/dbdesk-app → Report a vulnerability

  • In scope: the app, the sidecar API, the updater path, the plugin, and the published build pipeline.
  • Out of scope: the security of your own database, and anything that already requires code execution on the host as your user.
  • There is no bounty. There is a fix and credit in the changelog, if you want it.

SECURITY.md Privacy statement