Content
OWASP Security Best Practices
Systematic secure-coding defaults for web applications grounded in the OWASP Top 10:2025 and ASVS. Covers input validation, output encoding, authentication hardening, authorization enforcement, cryptographic hygiene, dependency & supply-chain management, and security review + incident-response workflows.
When to use
- Starting a new web application or API and need a security baseline
- Reviewing an existing codebase for hardening opportunities
- Adding user-facing forms, file uploads, or payment flows
- Preparing for a security audit or penetration test
- Onboarding a team to secure-coding standards
When NOT to use
- Pure static marketing sites with zero user input — reach for CSP headers only
- Embedded firmware or kernel-level security — reach for platform-specific hardening guides
- Threat modeling (use the
security-threat-modelskill instead)
Core concepts
- Defense in depth: multiple overlapping controls so no single failure is catastrophic
- Least privilege: every component gets the minimum permissions it needs
- Fail secure: errors deny access by default, never fail open
- Input validation: allowlist-first validation at every trust boundary
- Output encoding: context-aware encoding prevents injection in HTML, JS, SQL, URLs
- Secure defaults: ship with the strictest config; relax intentionally
- HTTP header sanitization: validate/sanitize header values before writing to sockets to prevent CRLF/SMUGGLING/SSRF gadget chains (see Axios advisory, CVE-2026-40175)