| name | vf-security-checklist |
| description | Use when touching auth, user input validation, file paths, redirects, WebSocket, uploads, rate limiting, CORS, or any security-sensitive code in veryfront |
Veryfront Security Checklist
Overview
Veryfront has undergone a comprehensive security audit. This checklist captures the verified patterns and known pitfalls.
Core principle: Validate at boundaries, use framework security utilities, never trust client input.
Before You Ship: Quick Check
Run through these when modifying security-sensitive code:
Input & Validation
Authentication & Tokens
Network & Routing
File System
Commands
Security Module Utilities
import {
validatePathSync,
validateTrustedHtml,
} from "#veryfront/security";
const safePath = validatePathSync(userInput, { baseDir: projectRoot });
const html = validateTrustedHtml(content);
Secure Patterns
Command Execution (Safe)
const cmd = new Deno.Command("git", {
args: ["log", "--oneline", "-n", "10"],
});
const cmd = new Deno.Command("sh", {
args: ["-c", `git log ${userInput}`],
});
Redirect Validation
const url = new URL(redirectTarget);
if (!["http:", "https:"].includes(url.protocol)) {
throw SECURITY_VIOLATION.create({
detail: "Invalid redirect scheme",
context: { protocol: url.protocol },
});
}
res.redirect(userProvidedUrl);
Rate Limiting
import { createRateLimiter } from "#veryfront/security";
const limiter = createRateLimiter({
maxRequests: 100,
windowMs: 60_000,
trustProxy: false,
});
const limiter = createRateLimiter({
maxRequests: 100,
windowMs: 60_000,
trustProxy: true,
});
Verified Secure Areas
These have been audited and are safe — don't over-engineer:
- Command injection: protected (array args throughout)
- XSS: protected (
validateTrustedHtml wrapper)
- HTML escaping: comprehensive (5 characters:
& < > " ')
- Path traversal: protected (
src/security/path-validation/)
- CSRF: protected (double-submit, constant-time compare)
- Cryptographic randomness: uses
crypto.getRandomValues()
Common Mistakes
| Mistake | Fix |
|---|
| Extracting JWT payload without verification | Verify signature first |
trustProxy: true without trusted proxy | Use trustProxy: false (default) for rightmost IP |
ws:// WebSocket in production | Enforce wss:// |
SecureFS.unsafeReadFile in prod code | Use safe variant with path validation |
| Missing auth on upload endpoint | Add auth middleware |
| Redirect without scheme check | Validate http: / https: only |
| String-concatenated commands | Use array args parameter |