Home / patterns

Passwords stored in plain text or with fast hashes

Quick answer: When an AI tool builds custom login instead of using an auth provider, it sometimes saves passwords as plain text, encrypts them with a key stored next to them, or hashes them with a fast hash like SHA-256 or MD5. If the database leaks, those passwords can be read or cracked quickly, and users who reuse passwords get hurt elsewhere too.

Last updated November 11, 2026

Steps

  1. Search the code for where users sign up and change passwords. Look for the column the password goes into and what happens to it first.
  2. Best fix: use your platform's auth (Supabase Auth, Firebase Auth, Clerk, Auth.js with a provider) so you never store passwords yourself.
  3. If you must store them, use Argon2id with at least the OWASP minimum settings (19 MiB memory, 2 iterations, 1 degree of parallelism), or scrypt. Use bcrypt only in legacy systems, with a work factor of 10 or more, and note its 72-byte input limit.
  4. Use the hashing library's built-in random salt per password. Never write your own hashing scheme.
  5. Never encrypt passwords so they can be decrypted, and never log them or send them in emails.
  6. Upgrade old hashes: when a user next signs in successfully, re-hash their password with the new algorithm. For plaintext or unsalted fast hashes, force a password reset.
  7. If plaintext or weakly hashed passwords were ever exposed in a backup, log or repo, treat it as a breach: reset passwords and tell users as your legal obligations require.

Why it matters

The OWASP Password Storage Cheat Sheet says passwords must be protected with strong, slow hashing algorithms such as Argon2id, bcrypt or PBKDF2, each with a unique salt, and that fast hashes such as SHA-256 aren't suitable because attackers can make huge numbers of guesses quickly. OWASP Top 10:2025 lists Cryptographic Failures (A04) and Authentication Failures (A07) among the most critical web app risks.

Sources

OWASP Cheat Sheet Series: Password Storage Cheat Sheet — https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html

OWASP Top 10:2025 — https://owasp.org/Top10/2025/

Related patterns

Found a problem you'd rather not fix yourself?

Tell us what's wrong. A StorenTech engineer reviews your app and replies with a fixed quote, so you know the cost before any work starts.

Get it fixed by StorenTech

Vibe Security Weekly

One email a week with new failure patterns and how to fix them.

By joining you agree we may email you this newsletter. See our privacy policy. Free. Unsubscribe anytime. We'll never sell your email.