You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Covers all P0–P3 findings from comprehensive security review:
RLS fix, auth graduation fix, CORS/CSP/rate-limiting, schema split,
named constants, PostHog SSR guard, dark mode alignment, doc fixes.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: .claude-plugin/marketplace.json
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -6,14 +6,14 @@
6
6
},
7
7
"metadata": {
8
8
"description": "Guided workflow for deploying multi-tenant SaaS on the Platform4Sync standard stack",
9
-
"version": "0.4.2"
9
+
"version": "0.5.0"
10
10
},
11
11
"plugins": [
12
12
{
13
13
"name": "webplatform4sync",
14
14
"source": "./",
15
15
"description": "Platform4Sync skill surface for multi-tenant SaaS on Cloudflare + Neon. Choose your frame: Construction (site → pour → frame → wire → finish) or Shu-Ha-Ri (shu → ha → ri). Same tools, different approaches. Includes diagnose-tokens diagnostic for silent failure detection.",
Copy file name to clipboardExpand all lines: CHANGELOG.md
+36Lines changed: 36 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,42 @@ All notable changes to Platform4Sync will be documented in this file.
4
4
5
5
This project adheres to [Semantic Versioning](https://semver.org/).
6
6
7
+
## [0.5.0] - 2026-02-22
8
+
9
+
### Security Hardening
10
+
11
+
-**RLS tenant isolation fix** — replaced broken `setTenantContext()` with transactional `tenantQuery()` wrapper. Neon HTTP driver executes each query as a separate HTTP request, so `set_config()` must be in the same Drizzle transaction as the data queries.
12
+
-**Auth graduation account takeover fix** — `graduateFromOAuth` now checks provider linkage before merging accounts, preventing email-based account takeover.
13
+
-**`verifyBetterAuthSession` implementation** — replaced stub with working session verification.
14
+
-**CORS hardening** — omit CORS headers entirely for disallowed origins; localhost only allowed when `ENVIRONMENT === "development"`.
15
+
-**Security headers** — added `Strict-Transport-Security`, `X-Content-Type-Options`, `X-Frame-Options`, `Referrer-Policy`, `Permissions-Policy`, and `Content-Security-Policy` to all responses.
16
+
-**Rate limiting** — KV-based rate limiting on `/api/auth/` endpoints (20 req/min per IP).
17
+
-**CSRF protection** — Origin-check middleware for custom API routes.
18
+
-**Session fixation prevention** — `onSessionCreated` callback in graduation bridge for post-creation session regeneration.
19
+
20
+
### Schema & Data Model
21
+
22
+
-**Schema split** — separated `platformSchema` (tenant infrastructure: tenants, domain_mappings, tenant_relationships) from `appSchema` (application tables). Platform tables live in the `platform` schema, app tables in `{{SCHEMA_NAME}}`.
23
+
-**Domain verification** — changed `verified: boolean` to `verifiedAt: timestamp` on `domain_mappings` for audit trail.
24
+
-**Runtime validation** — `rowToTenantContext` now validates tier, status, and isolation_mode values at runtime with descriptive errors.
25
+
-**Slug format validation** — DNS-safe slug regex check before database lookup.
26
+
27
+
### Quality Improvements
28
+
29
+
-**Named constants** — session durations extracted to `shared/contracts/constants.ts` (SESSION_TTL_SECONDS, SESSION_REFRESH_SECONDS, PREVIEW_SESSION_TTL_SECONDS), replacing inline magic numbers across auth, graduation, and middleware files.
30
+
-**PostHog SSR guard** — `posthog.ts` now returns early when `typeof window === "undefined"`, preventing server-side crashes.
0 commit comments