WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] Security issue: Unencrypted password saved into database! (5 posts)

  1. jleander
    Member
    Posted 7 months ago #

    Hello. This is not a question. More of a security HEADS UP for the plugin author.

    Events Manager creates option_name dbem_smtp_password inside wp_options table, which stores the password added in E-mail settings -> SMTP -> SMTP password.

    This is done unencrypted which really creeps me out.

    Even worse is that if you leave the username and password fields empty and save, the next time you enter this page your browser will prefill these fields with your wordpress login data (if you ever allowed your browser to remember your login information). Now when you save the settings again, your wp username and password will be stored inside database unencrypted.

    This prefill seems to happen even if smtp settings page is not active -> you could be using php post settings and still smtp settings would store your password and username if fields left empty.

    I think the best and easiest way to fix this issue would be storing the password encrypted, which should be the way it's done in the first place. Never ever store passwords unencrypted.

    Another way would be to make sure that this smtp username and password field has nothing to do with wordpress login form, since now it seems like your browser is messing these up.

    My setup:

    WP 3.7.1 and Events Manager 5.5.2.
    OS Mavericks 10.9 / Google Chrome 31.0.1650.57

    Please look into this. Otherwise it's a great plugin so it's a shame there's security issue like this. Thank you.

    http://wordpress.org/plugins/events-manager/

  2. caimin_nwl
    NetWebLogic Support
    Posted 7 months ago #

    Hi,

    Thanks for taking the time to let us know about this. To be honest, I'm not sure if this is an oversight or if there's a reason behind it. I'll ask Marcus to take a look at this thread ASAP.

  3. caimin_nwl
    NetWebLogic Support
    Posted 7 months ago #

    I asked Marcus for this thoughts. His reply is below.

    After further inspection, there's a simple reason for this. SMTP passwords aren't encrypted because they need to be sent to the SMTP server for validation. If you're not OK with this, then I suggest you choose PHP Mail instead, or use WP_Mail (which other plugins still do store passwords in cleartext too if forcing an SMTP transport on wp_mail).

    As for the password auto-fill, whilst that is a good point, this is something your browser is doing or a password manager you add to it which is not something we can control or account for. This is actually a good reason to turn auto-complete because it's not just an EM problem, as highlighted here - http://yoast.com/autocomplete-security/

    I guess the one thing we could do is not store a username/password at all if SMTP is not selected, which may help somewhat with the above.

  4. jleander
    Member
    Posted 7 months ago #

    Hi,

    Thank you for quick answer.

    I would suggest that you don't store username/password at all if SMTP is not selected. I never was on the SMTP settings page before debugging this issue, so it was really hard to find the setting that caused my auto-filled login information to be stored into the database.

    Of course password auto-fill has nothing to do with your plugin, but I just wanted to let you know, that this kind of behavior is possible. So in theory, if you are storing your login information when you log into wp, and visit the email settings page, you get your login information stored into the database unencrypted.

    What comes to saving password into the database unencrypted, it really doesn't make sense to me. Why not save encrypted and decrypt before sending to smtp server.

    I am currently working on pretty high level corporate site and we have to run a 3rd party security audit for the site, so this is why I was a bit scared when I saw my password in the db unencrypted ;)

    Anyways. Nice plugin. Keep up the good work.

  5. sitepad
    Member
    Posted 5 months ago #

    Hi,

    i too found this strange behaviour by accident.
    My wordpress login credentials were saved in plaintext in the option fields mentioned above. (the smtp-credentials need to be saved somewhere, ok, but the wordpress credentials sould never show up in these fields!)

    I couldn't figure out why this happens. The input field for "SMTP Username" uses "dbem_smtp_username" as id and name - that should be sufficiently unique.

    It happenened in Firefox 26.0 and Chromium 32, the latter one was used just once with the domain i tested this on.

    Anyways, i worked around this with a quick hack in events-manager/em-functions.php line 621

    Just add autocomplete="off" to the input field.

    What is the best way to fix this?

Reply

You must log in to post.

About this Plugin

About this Topic