Skip to content

Harden authz/XSS/entitlements and restyle to Google Developers UI - #14

Merged
myself-aas merged 1 commit into
mainfrom
arena/01a06478-catalystlab
Sep 3, 2026
Merged

Harden authz/XSS/entitlements and restyle to Google Developers UI#14
myself-aas merged 1 commit into
mainfrom
arena/01a06478-catalystlab

Conversation

@arena-ai-coding-agent

Copy link
Copy Markdown

Summary

  • Security: Express identity is fail-closed in production (server/core/authz.ts). GitHub webhook POST ownerId comes from verified uid; GET/SSE/DELETE are uid-scoped. Firestore reports require ownerId == uid; blog publish is limited to active Pro/Team/Enterprise or superadmin (not trialing). Telemetry IP hashing respects TRUST_PROXY; anomaly notify requires superadmin. Unauthenticated demo surfaces only when NODE_ENV=test and ALLOW_UNAUTH_DEMO=true.
  • XSS: Shared public/xss-guard.js plus CLEscape on public/*.html; dashboard uses escaped output and data-* click handlers. Client sanitizes hrefs (src/lib/sanitizeHref.ts).
  • UI: Frontend restyled to match Google Developers (DevSite layout, docs chrome, Material palette). MUI packages removed.
  • Ops: Tracked .env.example (no secrets); .gitignore ignores .env / .env.* with !.env.example.

npm test 175/175 and tsc --noEmit clean after these changes.

Intentional leftovers

  • Dual app/ + api/ + next.config.ts trees are not started by package.json (Express is live). Do not deploy Next/Vercel on those paths — the stream route trusts query tier and X-Forwarded-For. Cleanup is delete/quarantine, not a merge.
  • Local startUserTrial still writes trialing + pro; Firestore now denies that combo for publish.
  • Guest contact_inquiries create is unchanged.

Test plan

  • npm test (175) and ./node_modules/.bin/tsc --noEmit
  • Copy .env.example.env; confirm .env is gitignored and .env.example is not
  • Non-Pro / trialing user cannot publish a blog; active Pro and superadmin can
  • GitHub webhook GET/SSE only return the caller’s integrations; DELETE of another user’s hook is 403
  • With TRUST_PROXY unset, X-Forwarded-For does not change rate-limit or telemetry identity
  • Static public/*.html pages do not execute injected markup in dashboard/report fields
  • Docs and marketing pages match DevSite chrome (header, left nav, TOC)

Tighten Express identity, GitHub webhook ownership, Firestore report/blog
rules, and public HTML escaping. Track a commented .env.example and drop
MUI in favor of a DevSite-style layout.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
@vercel

vercel Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated
catalystlab Ready Ready Preview Sep 3, 2026 10:47am UTC

@myself-aas
myself-aas merged commit 27d43d7 into main Sep 3, 2026
3 of 4 checks passed
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