Skip to main content
Code Review

Return to Answer

Commonmark migration
Source Link

#Red flag

Red flag

 $query = "SELECT * FROM admin WHERE user = :user AND password = :pass";

Ok, so you've heard that you should hash passwords before storing them, because it turns out that pass is a SHA hash. But you don't seem to have heard of salt. The password database is going to be wide open to a rainbow table attack.

I would recommend that you use a framework which has a good password storage mechanism (if there is one). If not, read the OWASP Password Storage Cheat Sheet very carefully before you rewrite this code.

#Red flag

 $query = "SELECT * FROM admin WHERE user = :user AND password = :pass";

Ok, so you've heard that you should hash passwords before storing them, because it turns out that pass is a SHA hash. But you don't seem to have heard of salt. The password database is going to be wide open to a rainbow table attack.

I would recommend that you use a framework which has a good password storage mechanism (if there is one). If not, read the OWASP Password Storage Cheat Sheet very carefully before you rewrite this code.

Red flag

 $query = "SELECT * FROM admin WHERE user = :user AND password = :pass";

Ok, so you've heard that you should hash passwords before storing them, because it turns out that pass is a SHA hash. But you don't seem to have heard of salt. The password database is going to be wide open to a rainbow table attack.

I would recommend that you use a framework which has a good password storage mechanism (if there is one). If not, read the OWASP Password Storage Cheat Sheet very carefully before you rewrite this code.

Source Link
Peter Taylor
  • 24.4k
  • 1
  • 49
  • 94

#Red flag

 $query = "SELECT * FROM admin WHERE user = :user AND password = :pass";

Ok, so you've heard that you should hash passwords before storing them, because it turns out that pass is a SHA hash. But you don't seem to have heard of salt. The password database is going to be wide open to a rainbow table attack.

I would recommend that you use a framework which has a good password storage mechanism (if there is one). If not, read the OWASP Password Storage Cheat Sheet very carefully before you rewrite this code.

lang-php

AltStyle によって変換されたページ (->オリジナル) /