Security Checklists

PHP Website Security Checklist Before Launch

Review authentication, access control, input handling, uploads, configuration, dependencies, and recovery before launching a PHP website.

Authentication and sessions

  • Passwords use password_hash() and password_verify().
  • Login attempts are rate-limited.
  • Session cookies use HTTPS, HttpOnly, and an appropriate SameSite policy.
  • Session IDs are regenerated after login.
  • Password reset tokens are random, single-use, and time-limited.

Input and output

  • SQL values use prepared statements.
  • Dynamic SQL identifiers use strict allowlists.
  • HTML output is escaped in the correct context.
  • State-changing forms use CSRF protection.
  • File uploads have size and content checks.

Authorization

  • Every protected route checks permissions server-side.
  • Users can access only records they are authorized to see.
  • Administrative functions have additional protection.
  • Download and export endpoints enforce access checks.

Server and deployment

  • HTTPS is enabled.
  • Production errors are logged, not displayed.
  • Secrets and private files are outside the public web root.
  • Dependencies are reviewed with Composer audit.
  • File permissions are restrictive.
  • Backups and restoration have been tested.

This checklist is a starting point, not a formal security certification. Test the application against threats relevant to its data and users.