Security

Facebook stored passwords in plain text: a lesson for site owners

In March Facebook admitted that hundreds of millions of user passwords were kept in plain text in internal logs. How should passwords be protected on your own site?

Facebook stored passwords in plain text: a lesson for site owners

In March 2019 Facebook said the passwords of hundreds of millions of users had been stored in plain text in the company's internal logs. According to the company there was no evidence of abuse, but employees could see them. The lesson is simple: even a large company can make this mistake.

How should passwords be stored?

Never store the password itself. Store its hash (an irreversible "fingerprint") instead. On sign-in, the hash of the entered password is compared with the one in the database.

  • Use modern, deliberately slow algorithms: bcrypt or Argon2.
  • MD5 and SHA-1 are unsuitable for passwords: they are cracked in seconds.
  • Each password needs a unique salt; modern libraries do this for you.
  • Do not write passwords to logs, emails or error messages.

For WordPress and ready-made CMS owners

Ready-made CMSs store passwords correctly, but only in current versions. Update old ones, turn on two-factor authentication for admins and delete unused users.

Advice for users

  1. A separate password for every site.
  2. A password manager (the easiest way with many accounts).
  3. Two-factor authentication wherever possible.

A security check for your site: hosting and protection.

Found it useful? Share it:

Get new articles by email

One or two emails a month: practical tips on websites, hosting and security. Unsubscribe any time with one click.