1

A Wordpress plugin I am using for using a SMTP server instead of the server's built in mail function is stating:

The password [SMTP password] is stored in plain text. We highly recommend you setup your password in your WordPress configuration file for improved security...

So while I understand this is different from a login situation where you can check against a password hash and don't have to store the plaintext, is there no better way for the plugin to have access to the SMTP password and not store it in plaintext?

Does their suggestion of shifting the plaintext password's location from the database to a config file make any real difference - in general and in regard to Wordpress?

4

So while I understand this is different from a login situation where you can check against a password hash and don't have to store the plaintext, is there no better way for the plugin to have access to the SMTP password and not store it in plaintext?

The plugin needs to have access to the plain password in order to do SMTP authentication. While one might encrypt the password this only moves the problem since one now would need to store the encryption key somewhere accessible to the plugin.

Does their suggestion of shifting the plaintext password's location from the database to a config file make any real difference - in general and in regard to Wordpress?

In case there is a successful SQL injection the password might be read from the database. For reading a config file instead the server either has to be configured insecurely by making this file accessible from outside or there need to be another way the attacker can access data on the server, for example using some remote code execution vulnerability. But in this case the attacker will also have access to the database too since the database credentials are also stored in some config file.

Thus, neither solution provides absolute security. But the risk of using a properly protected config file might be the smaller one.

  • I'd also argue that, considering how I think WP works, read access to config/PHP files is basically game over and grants access that would include the database, on many systems. Generally, I'd argue that using a potentially buggy PHP mail solution might generally be a worse idea than to properly configure your local mailer. – Marcus Müller Mar 29 '18 at 17:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.