Skip to main content

Security

Terra uses defense-in-depth: multiple layers of protection for sensitive data.

Security Utilities

All security functions live in src/lib/security.ts:

XSS Prevention

All user-generated HTML is sanitized:

Path Traversal Protection

Three-layer validation for file paths:

Open Redirect Prevention

Rate Limiting

Fail-Secure Pattern


Encryption

PII encryption

Authentication

Auth security