Developer Security Checklist: Building Secure Applications
A comprehensive security checklist for developers. Covers OWASP Top 10, secrets management, dependency security, API security, and more.
In This Guide
The OWASP Top 10 lists the most critical web application security risks.
1. Broken Access Control
- Users accessing other users' data by changing IDs in URLs
- Missing function-level access checks
- Fix: Deny by default, implement RBAC, test authorization rules
- Storing passwords in plaintext or weak hashes
- Using HTTP instead of HTTPS
- Fix: Use Argon2id for passwords, TLS 1.3 everywhere, encrypt sensitive data at rest
- SQL, NoSQL, OS, LDAP injection
- Fix: Parameterized queries, ORMs, input validation, WAF
- Missing threat modeling and security architecture
- Fix: Threat model early, use secure design patterns, abuse case testing
- Default credentials, unnecessary features, verbose errors
- Fix: Hardened configs, automated security scanning, principle of least privilege
- Using libraries with known vulnerabilities
- Fix: Dependabot/Renovate, npm audit, regular updates
- Weak password policies, credential stuffing, session fixation
- Fix: Strong password policies, rate limiting, 2FA, secure session management
- Insecure deserialization, untrusted CI/CD pipelines
- Fix: Verify software integrity, signed artifacts, secure pipeline
- Not logging security events, no alerting
- Fix: Log auth events, detect anomalies, incident response plan
- Application fetches URLs without validation
2. Cryptographic Failures
3. Injection
4. Insecure Design
5. Security Misconfiguration
6. Vulnerable Components
7. Authentication Failures
8. Data Integrity Failures
9. Logging & Monitoring Failures
10. Server-Side Request Forgery (SSRF)
Never commit secrets to source control. This is the #1 developer security failure.
What counts as a secret:
- API keys and tokens
- Database connection strings
- Private keys (SSH, TLS, signing)
- OAuth client secrets
- Webhook URLs with tokens
- Any credential or password
.gitignoreโ Always exclude .env, .pem, .key files
Protection layers:
- Pre-commit hooks โ Use tools like git-secrets, truffleHog, or gitleaks
- Environment variables โ Never hardcode secrets, use env vars
- Secrets manager โ Use a dedicated service:
- AWS Secrets Manager / Parameter Store
- GCP Secret Manager
- Azure Key Vault
- Doppler (developer-focused)
If you accidentally commit a secret:
- Rotate the secret IMMEDIATELY (revoke and create new)
- Remove from git history:
git filter-branchorBFG Repo-Cleaner - Force-push the cleaned history
- Assume the secret is compromised (even if removed, it may be cached)
- Use your CI platform's secret storage (GitHub Secrets, GitLab CI variables)
CI/CD secrets:
Your application's dependencies are part of your attack surface.
The threat:
- The average JavaScript project has 1,500+ transitive dependencies
- Typosquatting attacks: "loadsh" (typo) vs "lodash" (real)
- Compromised maintainer accounts uploading malicious versions
- Protestware: Maintainers intentionally sabotaging their own packages
Defense strategies:
1. Audit and monitor:
npm audit # Check for known vulnerabilities
npx audit-ci # Fail CI on vulnerabilities
2. Automate updates:
3. Lock dependencies:
4. Evaluate before adding:
5. Advanced measures:
Authentication:
- Use OAuth 2.0 / OpenID Connect for user authentication
- Use API keys + HMAC for service-to-service
- JWTs: short expiry (15 min), refresh tokens (7 days), rotate signing keys
- Never pass tokens in URL query parameters
- Implement at the API layer, not just the frontend
- Use object-level access checks (not just endpoint-level)
- Rate limit by user, IP, and API key
- Implement scoped permissions (principle of least privilege)
- Validate ALL input on the server side
- Use schema validation (Zod, Joi, JSON Schema)
- Reject unexpected fields (allowlist, not denylist)
- Sanitize output to prevent XSS
- TLS 1.3 required (no exceptions)
- HSTS header with long max-age
- Pin certificates for mobile apps (certificate transparency)
- Never expose stack traces or internal details in production
- Use generic error messages for clients
- Log detailed errors server-side
- Don't differentiate between "user not found" and "wrong password"
- Log all authentication events
- Alert on unusual patterns (brute force, credential stuffing)
- Track API usage per key/user
Authorization:
Input validation:
Transport security:
Error handling:
Monitoring:
During development:
During code review:
During CI/CD:
In production: