Skip to content

ibrahimraimi/web-application-security-checklist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Web Application Security Checklist

This document outlines the minimum security standards and policies to follow in a web application to ensure compliance with modern web security best practices.

Inspired by OWASP, browser security standards, and real-world production requirements.

1. Authentication (Identity)

Implemented / Required

  • Passwords are hashed using bcrypt or argon2
  • No plaintext passwords stored or logged
  • Authentication handled server-side
  • Sessions or tokens have expiration
  • Logout invalidates active sessions
  • Refresh tokens are stored securely
  • Account enumeration is prevented (generic error messages)

Cookie Security (if using cookies)

  • HttpOnly
  • Secure
  • SameSite=Lax or SameSite=Strict

2. Authorization (Access Control)

Implemented / Required

  • Role-Based Access Control (RBAC)
  • Permissions validated on the server
  • Users can only access their own resources
  • Admin-only routes are protected
  • No authorization logic relies solely on frontend checks

Rule: UI checks are not security checks.

3. Input Validation & Output Safety

Implemented / Required

  • All inputs validated server-side
  • Request schemas enforced (Zod, Yup, Joi)
  • Query parameters validated
  • Headers validated where applicable
  • SQL queries are parameterized
  • User-generated content escaped before rendering
  • File uploads validated (type, size, content)

Rule: Never trust user input.

4. Browser Security Headers

Implemented / Required

  • Content-Security-Policy (CSP)
  • X-Frame-Options (DENY or SAMEORIGIN)
  • X-Content-Type-Options: nosniff
  • Referrer-Policy configured
  • Permissions-Policy configured

Default mindset: If it is not explicitly allowed, it should not run.

5. Transport & Network Security

Implemented / Required

  • HTTPS enforced everywhere
  • TLS 1.2+ only
  • HSTS enabled
  • CORS explicitly configured
  • No wildcard origins when credentials are used
  • Rate limiting on authentication endpoints
  • Rate limiting on public APIs
  • Brute-force protection implemented

6. Backend & Infrastructure Security

Implemented / Required

  • Secrets stored in environment variables
  • .env files never committed
  • Database is not publicly accessible
  • Least-privilege database users
  • Containers run as non-root
  • Logs do not contain sensitive data
  • Monitoring and alerting enabled

7. Data Privacy & Compliance

Implemented / Required

  • Data minimization applied
  • Only required user data collected
  • User data deletion supported
  • Clear privacy policy provided
  • Compliance with GDPR
  • Compliance with NDPR (Nigeria)

8. Dependency & Supply Chain Security

Implemented / Required

  • Dependencies audited regularly
  • No unmaintained or abandoned packages
  • Lockfiles committed
  • Automated security scanning enabled
  • Known vulnerabilities patched promptly

9. Error Handling & Logging

Implemented / Required

  • No stack traces exposed in production
  • Generic error messages returned to clients
  • Detailed errors logged server-side
  • Authentication and authorization events logged
  • Suspicious activity monitored

10. Security Principles Followed

  • Least Privilege
  • Defense in Depth
  • Secure by Default
  • Fail Closed, Not Open
  • Zero Trust (client is untrusted)
  • Breach containment over breach prevention

About

This document outlines the minimum security standards and policies to follow in a web application to ensure compliance with modern web security best practices.

Topics

Resources

License

Stars

Watchers

Forks

Contributors