PushizoDocs
Security & compliance

Security review — OWASP ASVS 4.0 (Level 2) checklist (Phase 14)

Date: 2026-10-13. Scope: API (apps/api), worker, dashboard, SDK endpoints, data layer. Each item is tied to evidence verified in the code (file/test); "partial"/"open" items are tracked before go-live in GO_LIVE_CHECKLIST.md.…

Date: 2026-10-13. Scope: API (apps/api), worker, dashboard, SDK endpoints, data layer. Each item is tied to evidence verified in the code (file/test); "partial"/"open" items are tracked before go-live in GO_LIVE_CHECKLIST.md. An external pentest is optional (plan 09 Phase 14) and uses this list as input.

Status: ✅ met · 🟡 partial/operational condition · ⬜ out of scope (v2)

V1 Architecture and design

#ControlStatusEvidence
1.1Threat model and security requirements are documented✅docs/plan/08-guvenlik-ve-operasyon.md, ADR-0008 (key vault), ADR-0016 (SDK proof of ownership), ADR-0020 (quota/suspension)
1.4Access control is enforced at a single point✅AuthGuard → RateLimitGuard → TenantGuard (APP_GUARD order, apps/api/src/app.module.ts); platform admin PlatformAdminGuard
1.5Schema validation at input/output boundaries✅Zod DTOs (nestjs-zod), ZodValidationPipe on all body/query parameters; error envelope AppExceptionFilter
1.9No secrets in code✅npm run ci:local secrets scan (1132+ files), .env.example contains placeholders only

V2 Authentication

#ControlStatusEvidence
2.1.1Password length/policy✅passwordIssues (packages/auth/src/password.ts): at least PASSWORD_MIN_LENGTH characters, at most 128, at least two character classes; AuthService.assertPasswordPolicy on sign-up/change/reset
2.1.7Password hashing: Argon2id✅packages/auth/src/password.ts (@node-rs/argon2)
2.2.1Brute-force protection✅5 failures / 15-minute lockout + increasing delay (LOCKOUT_MAX_FAILURES), IP-based @RateLimit(AUTH_RATE)
2.2.3New device/location notification✅new_login email (establishSession)
2.5Password reset: single-use, time-limited token; email existence is not leaked✅email_tokens (sha256, 1 hour), constant response from forgotPassword
2.7–2.8MFA (TOTP + recovery codes), enforcement at the org level✅MfaService, organizations.settings.mfaRequired (TenantGuard), mandatory for platform admins
2.9OAuth sign-in: state + PKCE, verified email, return URL only on our own domain✅OAuthService (state in Redis for 10 min, S256, return_to only /…)
2.10Service credentials (provider keys) are encrypted and not logged✅Envelope encryption (data_keys, MASTER_KEY), secret_enc; audit metadata masked

V3 Session management

#ControlStatusEvidence
3.2Session token is opaque, 256 bits, sha256 on the server side✅SessionService.create (generateOpaqueToken(32))
3.3Logout and timeout; absolute age policy✅14-day sliding, org sessionMaxHours, revokeAll, session list
3.4Cookie flags✅httpOnly, secure (prod), SameSite=Lax (common/cookies.ts)
3.5API keys: hashed storage, scopes, IP allowlist, rotation, instant revocation✅api_keys.key_hash, Redis revoked flag, ip_allowlist, /rotate
3.7Re-authentication for privilege changes (password/MFA change)✅changePassword/mfa.disable require the current password + code

V4 Access control

#ControlStatusEvidence
4.1.1Tenant isolation in every query + RLS✅TenantGuard org/app resolution (nonexistent → 404), TenantRlsInterceptor (set_config per request), tenant-isolation.int.test.ts + an isolation case in every phase's tests
4.1.3Least-privilege roles✅packages/tenancy/src/roles.ts (owner…viewer, composer), API key scopes, plan role gate
4.2.2CSRF✅double-submit (hs_csrf cookie = x-csrf-token) on /internal mutations (http-hooks.ts), SameSite=Lax
4.3.1Separate identity and MFA for the admin interface✅/admin/v1 + is_platform_admin (SQL/seed only) + MFA; support sessions are read-only and audited
4.3.3Access by suspended tenants✅HS_ORG_SUSPENDED in API/dashboard/SDK (phase13.int.test.ts)

V5 Validation, sanitization and encoding

#ControlStatusEvidence
5.1Positive validation, size limits✅Zod schemas (length/enum/regex), bodyLimit 1 MB (event batch 5 MB, webhook 256 KB)
5.2.2HTML sanitization (email/in-app content)✅MJML/Liquid rendered on the server, dashboard preview with DOMPurify; in-app is block-based (no raw HTML)
5.2.6SSRF✅packages/webhooks/src/ssrf.ts (private ranges after DNS resolution, redirects disabled), same check for the journey webhook node, WEBHOOK_ALLOW_INSECURE_TARGETS dev only outside the mock provider
5.3.3Output encoding (preference center/unsubscribe pages)✅escapeHtml on all dynamic fields (tracking.service.ts), email templates (mail/templates.ts)
5.3.4SQL injection✅Drizzle parameterized queries; raw sql templates are parameterized only
5.5.2Safe JSON parsing✅Fastify JSON parser + depth/size limit; raw webhook bodies are parsed only after signature verification

V6–V8 Cryptography, errors/logging, data protection

#ControlStatusEvidence
6.2Approved algorithms✅AES-256-GCM envelope (ADR-0008), HMAC-SHA256 signatures (webhooks, tracking, Stripe/iyzico), Argon2id, VAPID ES256
6.4Key rotation✅docs/runbooks/key-rotation.md, data_keys versioning
7.1No secrets in logs; request_id✅pino redaction, API request logs contain metadata only (api_request_logs), audit metadata masked (value_masked)
7.4Error responses do not leak internal details✅AppExceptionFilter → standard envelope (HS_INTERNAL generic message, request_id)
8.1PII: hashed lookup, masked display, export/log masking✅token_hash, suppression digests, a***e@pushizo.com; KVKK (Turkish data protection law)/GDPR deletion and export (privacy.int.test.ts)
8.3.4Data retention periods✅retention job (plan limit retention_days), partition dropping

V9–V10 Communication and malicious code

#ControlStatusEvidence
9.1TLS; HSTS🟡HSTS header in prod (http-hooks.ts); TLS termination in infra/compose nginx/caddy (certificate at go-live)
10.3Dependency scanning✅npm audit --audit-level=high (ci:local audit: high=0, critical=0), lockfile committed; CI ci.yml

V12–V14 Files, API, configuration

#ControlStatusEvidence
12.1File upload limits (CSV import, media)✅import multipart size limit, MIME/size checks, S3 signed URLs for 24 h
13.1API: authorization, rate limiting, idempotency✅scope/permission guards, token bucket (plan-based api_rps), Idempotency-Key for 24 h
13.2Webhook receivers verify signatures✅SNS/Svix/Twilio/Stripe/iyzico/mock signatures, raw body, time tolerance
14.4Security headers✅API: x-content-type-options, referrer-policy, permissions-policy, x-frame-options, HSTS; dashboard: CSP (next.config.ts), same headers
14.5CORS✅/sdk origin check (allowed_origins), dashboard only APP_URL
14.2Production configuration and dependencies✅NODE_ENV=production startup checks: mock billing is rejected, mock providers only with ALLOW_MOCK_PROVIDERS=true (staging), WEBHOOK_ALLOW_INSECURE_TARGETS cannot be enabled, MASTER_KEY is required, the application DB role cannot be a superuser/BYPASSRLS (assertRlsEnforced); dependencies: Dependabot (npm, Actions, Docker, Gradle, Maven, NuGet, pip, Bundler, Composer, Go, pub), npm audit --audit-level=high (ci:local), gitleaks git history scan (CI)

Open / out of scope

  • External penetration test (optional; this list is the input).
  • SSO (SAML/OIDC), JWT identity verification mode — v2 (ADR-0017).
  • WAF/bot protection — infrastructure layer (go-live).

On this page