Skip to content

fix(dashboard): stop sending database connection strings to the browser - #893

Merged
timgit merged 1 commit into
masterfrom
dashboard-db-url-leak
Sep 4, 2026
Merged

fix(dashboard): stop sending database connection strings to the browser#893
timgit merged 1 commit into
masterfrom
dashboard-db-url-leak

Conversation

@timgit

@timgit timgit commented Sep 4, 2026

Copy link
Copy Markdown
Owner

The root loader returned the raw DatabaseConfig list, and React Router serializes a loader's return value into the HTML for hydration. Every configured connection string — passwords included — was therefore readable in page source by anyone who could load the dashboard, and with DATABASE_URL="...|..." that is every database the instance monitors.

Basic auth limits who can reach the page, but that's not a good excuse. This PR switches to a PublicDatabase on the server instead.

The root loader returned the raw DatabaseConfig list, and React Router
serializes a loader's return value into the HTML for hydration. Every
configured connection string — passwords included — was therefore readable
in page source by anyone who could load the dashboard, and with
DATABASE_URL="...|..." that is every database the instance monitors.

Basic auth limits who can reach the page, but it is a single shared
credential and does not make this acceptable: viewing a dashboard should not
hand over the credentials to write to the databases behind it.

Project to a PublicDatabase on the server instead. The schema stays — it is
not a credential, and the database selector renders it for any non-default
schema. Only `url` is dropped, and no client code ever read it: the sidebar
uses id, name and schema and nothing else.

Verified with a live server on a URL containing a marker password: zero
occurrences across /, /jobs, /queues and /warnings. The regression test fails
3 of its 5 cases against the unfixed loader.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HfGQCtytuqzDGxUch1tpCx
@timgit
timgit merged commit 74ac6c3 into master Sep 4, 2026
1 check passed
@timgit
timgit deleted the dashboard-db-url-leak branch September 4, 2026 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant