Skip to content

Releases

Dashboard v0.10.1

Choose a tag to compare

@fadymondy fadymondy released this 14 Oct 15:29
19c92a1

Security hardening from the v0.9.0 gate backlog (#4, PR #7).

  • Outbound SMTP is time-bounded (10s dial, 30s overall) and POST /api/dashboard/admin/mail/test is limited to 5 requests per minute (429 with Retry-After).
  • SMTP test failures report a fixed message per stage (connect, tls, auth, send) and a stage field; detail stays in the server log. 5xx responses show generic text in the UI.
  • The generic admin client sends the CSRF token on mutations, accepts only resources listed in NEXT_PUBLIC_TOGO_RESOURCES and encodes ids. Apps must list their admin tables in that variable (it already drove the resource list).
  • Host comparison is ASCII-only, host and username are trimmed on save, and omitting username on PUT keeps the stored login.

The known limitations listed in v0.10.0 still apply.

Dashboard v0.10.0

Choose a tag to compare

@fadymondy fadymondy released this 09 Oct 00:05
04842f3

⚠️ Known limitations: read before upgrading

  1. Split-origin login regression.
    • The dashboard page guard reads the togo_session cookie from the request that reaches Next.js. The default same-origin /api rewrite provides that cookie.
    • With a cross-origin NEXT_PUBLIC_API_ORIGIN, the cookie is set on the API's origin only, so every visitor is sent to /login, even when DASHBOARD_REQUIRED_ROLE is unset.
    • Deployments that serve the API from a different origin than the web app should not upgrade until this is resolved. Same-origin deployments are unaffected.
  2. An administrator who is impersonating someone can still open the page shell.
    • Impersonation issues a bearer token only and never replaces the browser cookie, so the administrator's own session still opens the dashboard pages.
    • Data APIs authorize the impersonation bearer independently.

What's new

  • Opt-in DASHBOARD_REQUIRED_ROLE (API environment) restricts every page under web/app/(app) (including /profile) to accounts holding that role (#5, #6).
    • Unset or blank (the default): any signed-in account, as in v0.9.0.
    • Set (e.g. admin): role membership is checked against the database on every request.
      • API tokens (PATs) and impersonated sessions are refused even when the account holds the role.
      • The setting is read when the API boots, so changing it needs a restart.
  • GET /api/dashboard/access answers 204 when the caller is allowed, 401 when they need to sign in and 403 when they are forbidden. The response is always Cache-Control: no-store, private.
  • Server-side DashboardGate in the (app) layout and on every (app) page denies hard loads, RSC requests, prefetches and soft navigations.
    • The Next server forwards only togo_session, and only to the server-side API_ORIGIN.
    • Timeouts, unexpected answers and an invalid API_ORIGIN fail closed.

What it does not do

  • It is not the data boundary. Each API still enforces its own authorization. /api/_meta/*, /graphql and /events are not covered by this setting.
  • It does not hide the UI code. The compiled client bundles under /_next/static remain publicly downloadable. They expose UI, endpoint and field names, but no data.
  • Unsetting the variable is a security downgrade, not a rollback.

Requirements

  • togo-framework/auth v0.10.0, already pinned.
  • No migrations.

Verification

  • CI on the merged head: go and web both green. The web job runs the end-to-end page-guard suite.
  • End-to-end page-guard suite: every (app) route, requested as a hard load, an RSC request, a prefetch and a soft navigation, by anonymous, forged, PAT, impersonated, non-admin and admin callers, plus demotion, deletion and the unset role (395/395).
  • Gate-coverage test: fails if any (app) page renders outside DashboardGate.
  • Security review: an independent review found no bypass. All three of its findings were fixed before the merge.

Full diff: v0.9.0...v0.10.0