Password field is insecure

ouzo - February 9, 2007 - 09:31
Project:SMTP Authentication Support
Version:6.x-1.x-dev
Component:User interface
Category:feature request
Priority:normal
Assigned:Unassigned
Status:reviewed & tested by the community
Description

It woud be nice if the smtp-password-field use the html input type="password" and stores the password in the database encrypted.

#1

dsp1 - March 14, 2007 - 12:13

i agree.

#2

baloneysammitch - March 19, 2007 - 14:07

Thirded.

#3

LukeLast - March 20, 2007 - 06:41

I could maybe settle for a hide password check box.

#4

mishhh - April 1, 2007 - 10:10

Second that

#5

smk-ka - April 3, 2007 - 15:18

What would be gained from an encrypted password? If I already have access to the database, I can easily retrieve the salt used and decrypt the password. Changing the field type sounds ok, though.

#6

dirkjot - September 10, 2008 - 13:51

This is a discussion which has been entertained endlessly for other applications. Basically, encrypting the password only prevents that an admin will accidentally learn your password. So you can argue encryption gives a false sense of security.

However, Drupal stores user passwords encrypted (in the 'pass' field of the 'user' table). So IMHO, smtp should follow that example and use encryption for the password and an appropriate html form element.

#7

Rob Loach - September 23, 2008 - 19:32

Yup.

#8

kylehase - November 21, 2008 - 01:36

Drupal uses a one-way hash on its password field. This is fine because it can simply hash passwords from the login form and match it against the stored hash. There is no reason Drupal needs to know the user's plain text password.

However, the SMTP password is used by Drupal to authenticate with a third party (SMTP server) so if you want to encrypt it you'd need to use a reversible encryption (mcrypt etc) to decrypt it before use. Since the decryption keys would have to be available to Drupal, anyone who has access to the Drupal files and database would also be able to decrypt the encrypted passwords. In other words, this would only add protection from people who have access to the database but do not have access to the Drupal files. Also, true reversible encryption requires PHP extensions which may not be installed on many hosts.

#9

sun - November 21, 2008 - 09:00
Assigned to:ouzo» Anonymous

Yes, the difference to user passwords is that typed in user passwords are also hashed before validation against the stored password. To be future-proof, SMTP module must not store the configured authentication credentials, so they can be encrypted/hashed on demand for SMTP servers that only support certain AUTH methods.

Additionally, site builders should be able to easily place SMTP credentials into settings.php.

#10

jeffschuler - June 15, 2009 - 03:08

Sounds like there are two separate issues here:

  • that a password form field should be used on the admin page to prevent over-the-shoulder reading of the password.
  • that the password is stored in the database in plain-text

The second doesn't block the first, does it?
Is there anything wrong with the simple change in the patch attached? It just makes the password field a real password field...

(If "false sense of security" is an issue, maybe a warning can be provided...)

AttachmentSize
smtp_117450_hide_password.patch 629 bytes

#11

jeffschuler - June 15, 2009 - 03:07
Version:5.x-1.x-dev» 6.x-1.x-dev
Status:active» needs review

#12

Rob Loach - June 15, 2009 - 15:44
Status:needs review» reviewed & tested by the community

This is good enough for now. Great work!

#13

mcrittenden - October 6, 2009 - 17:51
Title:smtp password Field» Password field is insecure

#14

k74 - October 7, 2009 - 17:19

To be included in the next version?

 
 

Drupal is a registered trademark of Dries Buytaert.