KASHA handles sensitive financial data. Security is not an afterthoughtβit's foundational to every architectural decision. This document outlines our security measures, vulnerability reporting process, and best practices for contributors.
Multi-Tenancy by Design
- Every database table includes
user_idfor row-level isolation - Global scopes automatically filter queries to the authenticated user
- Policies enforce authorization on every resource access
- Soft deletes prevent accidental data exposure
// Example: Transaction model with user isolation
class Transaction extends Model
{
protected static function booted()
{
static::addGlobalScope('user', function ($query) {
$query->where('user_id', auth()->id());
});
}
}- Session-based auth via Laravel Fortify/Breeze
- CSRF protection on all state-changing requests
- Password hashing with Laravel's bcrypt (Argon2ID)
- Two-factor authentication support (passkeys)
- Session invalidation on password change
- All financial amounts stored as
bigint(integer) - no floating-point precision issues - SQL injection prevention via Eloquent ORM and parameterized queries
- XSS protection via Laravel's blade escaping and Vue's text interpolation
- Rate limiting on authentication endpoints
- Input validation on all user data
- Inertia.js eliminates API surface - no REST/GraphQL endpoints to exploit
- Signed URLs for file downloads
- Signed cron job endpoints for scheduled tasks
- No direct database access from frontend
- Supabase Row Level Security (RLS) as defense-in-depth
- Vercel automatic HTTPS
- Environment variables for secrets (never committed)
- Database connection pooling via Supabase pooler (port 6543)
- Regular automated backups via Supabase
- MIME type validation for CSV uploads
- File size limits (configurable via
.env) - Virus scanning via Supabase Storage hooks
- Sanitization of CSV data before processing
- User-scoped storage paths
Do NOT open a public issue.
If you discover a security vulnerability, please disclose it responsibly:
- Email: maulanaferdi0678@gmail.com
- Subject:
[KASHA Security] - [Brief Description] - Include:
- Description of the vulnerability
- Steps to reproduce
- Potential impact
- Suggested fix (if known)
| Time Frame | Action |
|---|---|
| Within 48 hours | Acknowledge receipt of report |
| Within 7 days | Investigation and assessment |
| Within 14 days | Fix deployment or mitigation plan |
| Within 30 days | Public disclosure (with credit) |
- We will confirm receipt of your report within 48 hours
- We will provide regular updates on our progress
- We will credit you in the security advisory (if desired)
- We may offer a bug bounty for critical vulnerabilities
# β NEVER commit
.env
.env.local
*.key
*.pem
oauth-credentials.json// β
Correct
$apiKey = env('STRIPE_API_KEY');
// β Never hardcode
$apiKey = 'sk_live_1234567890';// β
Always validate
$request->validate([
'amount' => 'required|integer|min:0',
'category_id' => 'required|uuid|exists:categories,id',
]);
// β Never trust input directly
$transaction->amount = $request->amount;// β
Correct (Eloquent ORM)
$transactions = Transaction::where('amount', '>', 1000)->get();
// β Never raw SQL with user input
DB::select("SELECT * FROM transactions WHERE amount > $amount");// β
Validate file type
$validated = $request->validate([
'file' => 'required|mimes:csv,txt|max:10240', // 10MB max
]);
// β Never accept arbitrary files- Request only the permissions you need
- Use scoped database queries
- Apply policies to all controller actions
- Never expose user data to other users
Before submitting code, verify:
- No secrets committed (check
git diff) - All user input validated
- SQL queries use ORM or parameterized bindings
- File uploads validated and sanitized
- Authorization checks present (policies)
- CSRF tokens included in forms
- XSS escaping where appropriate
- Rate limiting on sensitive endpoints
- Error messages don't leak sensitive info
- Logging doesn't include secrets
-
Vercel PHP Runtime: Community-maintained, not official
- Mitigation: Plan B migration path to Railway/Fly/VPS documented
- Impact: Cold starts, function size limits
-
No Queue Worker: Vercel doesn't support persistent workers
- Mitigation: Vercel Cron + chunked processing
- Impact: Large CSV imports processed in chunks
-
Session Driver: Database-based (no Redis in free tier)
- Mitigation: Upgrade to Upstash Redis for production
- Impact: Slightly slower session access
- Implement audit logging for financial transactions
- Add device fingerprinting for suspicious activity detection
- Implement API rate limiting per user
- Add 2FA enforcement for sensitive operations
- Implement account locking after failed attempts
- Laravel Security Documentation
- OWASP Top 10
- Supabase Security Best Practices
- Vercel Security Features
We believe in responsible disclosure and will work with security researchers to:
- Acknowledge and validate reports
- Provide timely updates on remediation
- Credit researchers in security advisories
- Avoid legal action for responsible disclosure
We will never pursue legal action against researchers who:
- Follow this disclosure policy
- Report vulnerabilities responsibly
- Do not exploit or harm users
- Allow us reasonable time to respond
Security is a team effort. Thank you for helping keep KASHA safe.