Web Security Basics Every Developer Should Know
By Agegnehu Shibiru · · 9 min read
Passwords, sessions, input validation, access control and secrets management explained in plain language with practical checklists.
Security is a feature users never see
Users rarely notice good security, but they always notice a breach. The good news is that most real-world incidents come from a small set of well-known mistakes. Avoiding them does not require a security degree, just consistent habits.
Never store passwords in plain text
Passwords must be hashed with a slow, salted algorithm such as bcrypt or Argon2. Better still, use a trusted authentication provider so that you never handle raw passwords at all. Enforce a reasonable minimum length and check new passwords against lists of known leaked passwords.
Check permissions on the server, every time
Hiding a button in the interface does not stop someone from calling your API directly. Every read and write must be checked on the server or in the database. Row-level security policies are a powerful way to guarantee that a user can only access their own records, no matter which part of the code makes the request.
- Validate all input length, type and format on the server
- Use parameterised queries to prevent SQL injection
- Escape user content before rendering it to prevent cross-site scripting
Keep secrets out of your code
API keys, database passwords and signing secrets belong in environment configuration, never in a Git repository or front-end bundle. If a secret is ever committed, rotate it immediately; deleting the commit is not enough because copies may already exist.
Keep dependencies up to date
Modern apps rely on hundreds of packages. Enable automated dependency alerts and schedule a monthly update. The OWASP Top Ten is a free, regularly updated reference that every developer should read at least once.
This article is for general educational purposes. See our Disclaimer.