Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 191999 - net-mail/vpopmail logs clear passwords in mysql table
Summary: net-mail/vpopmail logs clear passwords in mysql table
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Security
Classification: Unclassified
Component: Default Configs (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo Security
URL:
Whiteboard: B? [ebuild?]
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-10 16:59 UTC by Matthias Jansen
Modified: 2007-09-24 16:40 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Jansen 2007-09-10 16:59:12 UTC
The vpopmail ebuild enables a complete logging of events including all successfully logins with clear passwords. Thats a huge security hole and should never be turned on by default!

Here is a patch to recover the default behaviour of vpopmail which only logs errors and without passwords:

-------------------------------------------
--- /usr/portage/net-mail/vpopmail/vpopmail-5.4.16.ebuild       2007-07-02 17:05:58.000000000 +0200
+++ vpopmail-5.4.16.ebuild      2007-09-10 18:47:49.000000000 +0200
@@ -90,7 +90,7 @@
                && myopts="${myopts} --enable-auth-module=mysql \
                        --enable-libs=/usr/include/mysql \
                        --enable-libdir=/usr/lib/mysql \
-                       --enable-sql-logging=y \
+                       --enable-sql-logging=e \
                        --enable-auth-logging=y \
                        --enable-valias=y \
                        --enable-mysql-replication=n \
-------------------------------------------

Reproducible: Always
Comment 1 Matthias Jansen 2007-09-10 17:02:27 UTC
Sorry, wrong patch attached in last post. This is the right one:


--------------------------------------------------------------------------
--- /usr/portage/net-mail/vpopmail/vpopmail-5.4.16.ebuild       2007-07-02 17:05:58.000000000 +0200
+++ vpopmail-5.4.16.ebuild      2007-09-10 19:00:29.000000000 +0200
@@ -116,7 +116,7 @@
                --enable-file-locking=y \
                --enable-file-sync=y \
                --enable-md5-passwords=y \
-               --enable-logging=y \
+               --enable-logging=e \
                --enable-log-name=vpopmail \
                --enable-qmail-ext \
                --disable-tcp-rules-prog --disable-tcpserver-file --disable-roaming-users \
--------------------------------------------------------------------------
Comment 2 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2007-09-10 17:42:23 UTC
CC'ing maintainer for advise.
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2007-09-10 21:25:18 UTC
This is very close to being invalid, but I'll leave it to the security folk to decide.

If you have USE=clearpasswd, the passwords are in the main 'vpopmail' table of users in plaintext anyway, because you NEED the plaintext to conduct CRAM-*/DIGEST-* authentication protocols (thus avoid replay attacks).

Additionally, the vlog table by logging what passwords were used is very useful in proving to users that their stupid Outlook/Eudora is caching the old password (and in seeing what passwords outside systems are trying to brute force you with).
Comment 4 Matthias Jansen 2007-09-11 07:18:43 UTC
(In reply to comment #3)
> This is very close to being invalid, but I'll leave it to the security folk to
> decide.
> 
> If you have USE=clearpasswd, the passwords are in the main 'vpopmail' table of
> users in plaintext anyway, because you NEED the plaintext to conduct
> CRAM-*/DIGEST-* authentication protocols (thus avoid replay attacks).

But as you already said it has to be activated with a USE flag and is not the default.

> Additionally, the vlog table by logging what passwords were used is very useful
> in proving to users that their stupid Outlook/Eudora is caching the old
> password (and in seeing what passwords outside systems are trying to brute
> force you with).

Of course there is a benefit from saving the complete event in the log table but I would highly appreciate to not enable this beaviour by default. I think that even the admin should have no possibility to see the plaintext password.
Comment 5 Benedikt Böhm (RETIRED) gentoo-dev 2007-09-16 07:56:42 UTC
both patches won't work, with mysql support vpopmail _always_ stores the password in the vlog table unless you completely disable sql-logging... your patch just prevents successful logins to be logged, but errors are still logged with password (of course if it is a login error, not the "real" password is logged, but there are other errors beside password failure ...)
Comment 6 Matthias Jansen 2007-09-16 13:09:58 UTC
(In reply to comment #5)
> both patches won't work, with mysql support vpopmail _always_ stores the
> password in the vlog table unless you completely disable sql-logging... your
> patch just prevents successful logins to be logged, but errors are still logged
> with password (of course if it is a login error, not the "real" password is
> logged, but there are other errors beside password failure ...)
> 


If noticed this as well. Thats why I changed the varchar length in mysql for the password column to zero so qmail tries to log the password but it won't get saved in the database.

At least for me this behaviour as a default is not a good idea. This should be at least be described in the messages after emerging so the user is aware of this.
Comment 7 Pierre-Yves Rofes (RETIRED) gentoo-dev 2007-09-22 18:22:12 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > both patches won't work, with mysql support vpopmail _always_ stores the
> > password in the vlog table unless you completely disable sql-logging... your
> > patch just prevents successful logins to be logged, but errors are still logged
> > with password (of course if it is a login error, not the "real" password is
> > logged, but there are other errors beside password failure ...)
> > 
> 
> 
> If noticed this as well. Thats why I changed the varchar length in mysql for
> the password column to zero so qmail tries to log the password but it won't get
> saved in the database.
> 

Sounds like a pretty dirty hack :/

> At least for me this behaviour as a default is not a good idea. This should be
> at least be described in the messages after emerging so the user is aware of
> this.
> 

net-mail, any opinion on this?
Comment 8 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2007-09-23 01:28:06 UTC
security: I'm against the change.
As I said if you have USE=clearpasswd, you have the clear passwords in the database already to support DIGEST-MD5/CRAM-MD5. Additionally, you should have permissions on your MySQL database that lock non-vpopmail users out of the vpopmail database.

Setting the passwd column of vlog to no length is useless, just think about the users that misconfigure stuff and swap their password and username (which happens far too often in my logs). The password then gets logged to the username column.

If somebody is that paranoid about it, they should set BOTH username and password column lengths to zero manually, and not have USE=clearpasswd, but also go and do similar lockdowns elsewhere in their system.
Comment 9 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2007-09-24 16:40:11 UTC
Closing this one as WONTFIX. If new arguments pop up feel free to reopen.