Interview Prep/DevSecOps/Vulnerability Management and OWASP

A security review finds passwords stored as unsalted MD5 hashes. How do you migrate without forcing every user to reset?

AdvancedScenarioVulnerability Management and OWASP
Answer

Situation read → Cryptographic failure (OWASP A02). Unsalted MD5 cracks in seconds with GPUs and rainbow tables.

What I'd do →

  1. Wrap existing hashes now: store argon2id(md5_hash) for every user in one migration, so no plain MD5 remains at rest.
  2. On next successful login, verify via the wrapped path, then re-hash the plain password with Argon2id (or bcrypt cost 12+) directly and mark the record upgraded.
  3. After a fixed period, force reset for accounts that never logged in.
  4. Treat the old database dumps and backups as compromised data; check who had access.
  5. Add a test or lint rule blocking md5/sha1 for password handling.

Why → Wrapping protects everyone today, not only those who log in again.

Interview tip → "Wrap, then upgrade on login" is the textbook migration pattern.

All DevSecOps questions Roadmap: Security in the pipeline

More on Vulnerability Management and OWASP