Security & Isolation
Multi-tenant companyId isolation, JWT verification, optional payload encryption, CORS policy, and clickjacking protection.
Multi-Tenant Isolation
Every enterprise collection in master-backend is strictly scoped by companyId. Authenticated requests resolve companyId from the verified JWT payload — never trusting a client-supplied tenant ID on protected operations.
Transport & Request Security
- NoSQL Injection Sanitization: All incoming JSON, query, and parameter payloads pass through
sanitizeMongoInputbefore reaching controllers. - Optional Payload Encryption: Sensitive client flows support
X-Payload-Encryptedmiddleware transparently at the Express gateway. - Strict CORS Policy: Trusted origins are enforced via
CORS_ORIGIN; only Formx public embeds (/api/forms/public/*) accept arbitrary origins withcredentials: false. - Anti-Clickjacking Headers: Backend responses enforce
X-Frame-Options: DENYandContent-Security-Policy: frame-ancestors 'none'. - Rate Limiting: Global API rate limiting plus stricter
authRateLimiterwindows protect login and SSO endpoints.
Third-Party SSO Sandboxing
Third-party Developer Console apps receive short-lived identity tokens (aud: 'ttf-identity', 1h TTL, no refresh token) restricted to GET /api/sso/userinfo. Internal authMiddleware explicitly rejects aud: 'ttf-identity' on every business route.
Last updated on
