Date: 2026-03-10 Scope: Full-stack (Web: Next.js, Mobile: Flutter, DB: Supabase)
BLIP is an end-to-end encrypted ephemeral communication platform. Overall security posture is solid, with proper E2EE implementation (Curve25519 + XSalsa20-Poly1305), parameterized database queries, and comprehensive rate limiting. This audit identified 4 code-level vulnerabilities (now fixed) and several configuration recommendations for production hardening.
Overall Score: 7.5/10 (8.5/10 after fixes applied)
- File:
web/src/app/api/board/batch-status/route.ts - Issue:
checkOrigin()was not called, allowing cross-origin CSRF attacks - Fix: Added
checkOrigin()validation andparseJsonBody()safe parsing
- File:
web/src/app/api/board/batch-status/route.ts - Issue:
Array.isArray(boardIds)only checks container type, not element types. Non-string elements could reach database queries - Fix: Replaced with
isStringArray(boardIds)which validates each element
- File:
web/src/components/chat/ChatRoom.tsx:99-101 - Issue:
Math.random()used as fallback for transfer ID generation (predictable, not cryptographically secure) - Fix: Replaced with
crypto.getRandomValues()for cryptographically secure random bytes
- File:
web/src/app/api/board/upload-image/route.ts:135-137 - Issue:
parseInt()can produce NaN or arbitrarily large values for width/height/displayOrder - Fix: Added bounds clamping (width/height: 0-10000, displayOrder: 0-100) with NaN fallback to 0
- File:
web/src/app/api/board/upload-image/route.ts - Issue: POST endpoint missing
checkOrigin()CSRF protection - Fix: Added
checkOrigin()validation
| # | Issue | Location | Recommendation |
|---|---|---|---|
| 1 | CSP allows unsafe-inline/unsafe-eval |
web/next.config.ts:38-39 |
Remove unsafe directives; sandbox ad scripts in iframe |
| 2 | Sensitive data in localStorage | web/src/hooks/useBoard.ts |
Move encryption keys/admin tokens to sessionStorage or memory-only |
| 3 | Ad script injection via dangerouslySetInnerHTML | web/src/components/MonetagAds.tsx |
Add Subresource Integrity (SRI); verify ad network legitimacy |
| # | Issue | Location | Recommendation |
|---|---|---|---|
| 4 | PBKDF2 iterations below NIST 2023 recommendation | web/src/lib/crypto/keys.ts:49 |
Upgrade from 100,000 to 120,000+ iterations |
| 5 | No certificate pinning (mobile) | mobile/lib/core/network/api_client.dart |
Implement cert pinning for Supabase and API domains |
| 6 | Missing iOS ATS configuration | mobile/ios/Runner/Info.plist |
Add explicit NSAppTransportSecurity policy |
| 7 | Rate limiting disabled in development | web/src/lib/rate-limit.ts:46-49 |
Ensure NODE_ENV is never 'development' in production |
| # | Issue | Recommendation |
|---|---|---|
| 8 | No MIME type whitelist for uploads | Validate file content type server-side |
| 9 | Console.error may expose DB details | Sanitize error logs in production |
- No hardcoded secrets — all credentials properly externalized via environment variables
- Strong E2EE — Curve25519 ECDH + XSalsa20-Poly1305 (NaCl), consistent across web and mobile
- SQL injection protected — all queries use parameterized Supabase client SDK
- Comprehensive rate limiting — applied to all sensitive endpoints via Upstash Redis
- Row Level Security — Supabase RLS properly configured
- HTTP security headers — HSTS, X-Frame-Options, X-Content-Type-Options, Referrer-Policy
- Screenshot/screen recording protection (mobile)
- Proper CSRF protection — origin validation on 31/31 POST endpoints (after fixes)
- Secure key derivation — PBKDF2 with salt for password-based keys
- No dangerous code patterns — no eval(), exec(), or unsafe deserialization