Skip to content

Fix host override and add session validation - #212

Merged
rmorehig merged 2 commits into
mainfrom
bugfix/dashboard-host-override-and-session-validation
Nov 3, 2026
Merged

rmorehig merged 2 commits into
mainfrom
bugfix/dashboard-host-override-and-session-validation

Conversation

@jordiori

@jordiori jordiori commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Tightens how the dashboard handles the server-side Tinybird token and session auth.

Changes

Tinybird host handling

  • The server TINYBIRD_TOKEN is now only ever sent to the configured TINYBIRD_HOST. Previously, a request could supply its own host via X-Tinybird-Host and the server token would be used against it.
  • When a client signs in with its own token, the host must be a Tinybird API host (https://api.*.tinybird.co), TINYBIRD_HOST, or listed in the new optional TINYBIRD_ALLOWED_HOSTS.
  • Credential resolution is centralized in resolveTinybirdCredentials() in lib/server.ts instead of being duplicated per route.

Removed /api/sql

  • The route had no callers since the hooks moved to pipes, and it allowed running arbitrary SQL with the server token. querySQL() and the QuerySQL type are removed with it.

Sessions

  • Session cookies are now HMAC-signed and expire after 7 days. Middleware and API routes verify the signature instead of only checking that the cookie exists.
  • Changing DASHBOARD_PASSWORD invalidates existing sessions.
  • Login uses constant-time comparison.

Breaking change

  • The admin/admin default credentials are removed. Username/password login requires DASHBOARD_PASSWORD to be set (DASHBOARD_USERNAME still defaults to admin).

…idate signed sessions

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@vercel

vercel Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
analytics-dashboard Ready Ready Preview Nov 3, 2026 11:49am UTC

@jordiori
jordiori requested a review from rmorehig November 3, 2026 11:22
The route ran arbitrary SQL with the server TINYBIRD_TOKEN and had no
callers since the hooks moved to pipes. Removing it means the server
token is only used for the fixed dashboard pipes and workspace lookup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rmorehig
rmorehig merged commit 46f434f into main Nov 3, 2026
5 of 6 checks passed
@rmorehig
rmorehig deleted the bugfix/dashboard-host-override-and-session-validation branch November 3, 2026 12:31

This branch was successfully deployed

1 active deployment
Preview — 9c8bd9b3 Deployed Nov 3, 2026 by vercel[bot]
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.

2 participants