Web Security – Best Practices for Web Application Authentication and Security

authenticationbrowserSecurityweb-applications

I got a question today from my manager asking me my thoughts on what is considered an acceptable design for authentication of a web form application, especially in regards to the nature of many popular browsers to "Remember Password" for your typical user name password login fields.

I am having trouble coming up with an answer that I feel is acceptable. In light of Sony's embarassing security flaws, I really want to be careful, even though the data being stored on people is of a lower sensitivity. We are not storing social security numbers or even addresses however we are storing phone numbers, email addresses and a photo of a visitor.

He is concerned that a user can simply Remember Password on a public terminal, then someone can simply jump on this terminal and begin viewing or modifiy data in an unauthorized way. I am fairly certain however that at least on Windows workstations that the browser will not "Remember Password" across Windows user accounts.

Beyond this I am implementing a one way password encryption at the server side (store encryped password in the database, encrypt user supplied password on the server, compare to encrypted string from database). There are no immediate plans to incorporate SSL encryption however this is still an option.

Are there are any major security flaws with this approach? Do you have any better suggestions?

Best Answer

Some high level tips:

  1. Store only the data you need
  2. Always encrypt sensitive data (SSN, password, credit card #, etc.) when you store it
  3. Always encrypt traffic using SSL when transmitting/receiving sensitive data
  4. If in doubt about the sensitivity of information, encrypt it
  5. Don't trust user input (someone will try to enter something bad)
  6. Don't trust your data (someone can change it in the database - injecting malicious script for example)
  7. Don't roll your own encryption
  8. Secure the servers hosting the applications / databases
  9. Increase the burden on end users for the sake of security (password restrictions, never expose passwords, don't send URLs in email, reduce session time, etc.)

My suggestion to you would be to get a book on securing Web applications. There is just too much information to convey in a single answer / blog / article. The topic of encryption alone is substantial.

Related Topic