CatatZ is committed to ensuring the security of user financial data and privacy. This document outlines our security policy, vulnerability reporting procedures, and the data protection architecture implemented within this repository.
Only the latest main version of CatatZ receives security updates and bug fixes.
| Version | Supported | Notes |
|---|---|---|
1.0.x (main branch) |
✅ | Active production version based on Next.js 16 App Router & Supabase |
< 1.0.0 |
❌ | Experimental / unsupported versions |
If you discover a potential security vulnerability in CatatZ, please do not report it through public GitHub Issues.
Please submit vulnerability reports privately to:
- Email:
catatz.app@gmail.com - GitHub Private Vulnerability Reporting: If enabled on this repository.
To help us triage and resolve the issue quickly, please include:
- A brief description of the vulnerability type (e.g., RLS bypass, session hijacking, XSS, CSRF).
- Steps to reproduce the issue (Proof of Concept / PoC).
- Affected module(s) or file(s) (e.g., Server Actions, PostgreSQL functions,
src/proxy.ts, etc.). - Potential impact on user data.
- Acknowledgement: Within 24–48 hours of receipt.
- Triage & Impact Assessment: Within 3–5 business days.
- Patch & Fix: Within 14 business days, depending on severity.
- Public Disclosure: Disclosure will occur only after a fix has been deployed and verified.
CatatZ applies a Defense-in-Depth strategy across all application layers:
- Supabase SSR Auth: Utilizes secure HTTP-only cookies with
SameSite=Laxattributes to prevent token theft via XSS. - Middleware Proxy (
src/proxy.ts): Validates and refreshes Supabase sessions on every authenticated request before rendering Server Components. - OAuth & Linking Protection: Google OAuth & Manual Identity Linking verify matching primary email addresses before allowing account linking.
- Row Level Security (RLS): Enforced on all user-owned tables (
transaksi,rekening,kategori,hutang,hutang_cicilan,anggaran,user_preferences). - User Data Isolation: Every
SELECT,INSERT,UPDATE, andDELETEquery is strictly restricted at the database level usingauth.uid() = user_id. SECURITY INVOKERFunctions: Triggers and stored procedures (such as automatic balance updates and debt settlements) execute under the logged-in user's permissions (SECURITY INVOKER), preventing privilege escalation.
- Ephemeral Execution: Uploaded transaction receipts for Auto Fill are processed temporarily in-memory within Server Actions and transmitted directly to the Gemini API via
AI_API_KEY. - Zero Data Retention: Receipt images are never stored in Supabase Storage, database tables, disk caches, or production logs.
- Strict File Validation: Validates MIME types (
image/jpeg,image/png,image/webp,application/pdf) and enforces file size limits (max 4.5 MB).
- Public Bucket
avatars: Restricted strictly to public user avatar images. - Path-Isolated Storage RLS: Storage RLS policies restrict
UPDATEandDELETEpermissions exclusively to subfolders matching the user's ID (auth.uid()). - No Private Documents: Private financial documents or transaction records are strictly prohibited from public storage buckets.
- NetworkOnly Strategy: All HTTP
POSTrequests and sensitive routes under/api/*are configured withNetworkOnlyin the Service Worker (serwist.config.ts), preventing offline caching of sensitive mutations or authentication state. - Isolated Precache: PWA cache only stores static UI assets (
.html,.js,.css,manifest.json) and theoffline.htmlfallback page.
Configured HTTP Security Headers in next.config.ts:
X-Content-Type-Options: nosniff— Prevents MIME-type sniffing.X-Frame-Options: DENY&Content-Security-Policy: frame-ancestors 'none'— Protects against Clickjacking attacks.Referrer-Policy: strict-origin-when-cross-origin— Controls referrer information leakage.Permissions-Policy: camera=(), microphone=(self), geolocation=(), payment=(), usb=()— Disables unused browser hardware capabilities.poweredByHeader: false— Removes theX-Powered-By: Next.jsheader.
- Sensitive keys such as
AI_API_KEYand Supabase Service Role Keys remain server-side only and must never be exposed viaNEXT_PUBLIC_prefixes. - Configuration files
.envand.env.localare explicitly ignored in.gitignoreand never committed to source control.
For developers contributing to or self-hosting CatatZ:
- Run Automated Verification:
npm run verify:quickfor ESLint, TypeScript typechecks, and Vitest unit tests.npm run verifyfor full verification including Playwright E2E tests and production PWA builds.
- Immutability of Database Migrations:
- Migration files in
src/migrations/are immutable. Always create a new.sqlmigration file for schema or RLS changes.
- Migration files in
- Audit New RLS Policies:
- Any new table MUST include
ALTER TABLE <table_name> ENABLE ROW LEVEL SECURITY;along withWITH CHECKandUSINGpolicies bound toauth.uid().
- Any new table MUST include
Last updated: August 2026.