Author Topic: 3.3 upgrade - dovecot allows any password from localhost (eg webmail)  (Read 2721 times)

otoh

  • Zen Apprentice
  • *
  • Posts: 34
  • Karma: +1/-0
    • View Profile
Just recently upgraded to 3.2 (which broke my smb) then to 3.3 (which loosely fixed it - will try to figure out how/why and post elsewhere). I just discovered that in webmail (I have a separate Roundcube installed, not the Zentyal one) that you could log in with any password to any user account. Not ideal!

Traced it to: /usr/share/zentyal/stubs/mail/dovecot.conf.mas - which contains this:

Code: [Select]
passdb {
    driver = static
    args = nopassword=y allow_nets=127.0.0.1/32
}

This seems to do, well, exactly that - allow any password when connecting from localhost (ie using webmail). I commented out this section and that seems to fix it. Looking at git, this arrived in 3.2... although I can't imagine why. Am I missing something - is this deliberate, or a bug?

jkerihuel

  • Zentyal Staff
  • Zen Warrior
  • *****
  • Posts: 152
  • Karma: +18/-3
    • View Profile
Re: 3.3 upgrade - dovecot allows any password from localhost (eg webmail)
« Reply #1 on: January 05, 2014, 08:52:05 pm »
This seems to do, well, exactly that - allow any password when connecting from localhost (ie using webmail). I commented out this section and that seems to fix it. Looking at git, this arrived in 3.2... although I can't imagine why. Am I missing something - is this deliberate, or a bug?

Hi,

The nopassword=y for 127.0.0.1 has been added on purpose within the context of openchange module implementation and dovecot authentication through SOGo libraries requirements.

The roundcube package Zentyal provides therefore adjust the configuration to work around this issue and had furthermore been identified and fixed during 3.3 development process:


If you want to use a custom roundcube package, adjust the IP address your webmail binds on to a different one than 127.0.0.1.

Br,
Julien.
Twitter: http://twitter.com/jkerihuel
Key fingerprint = 08BA 50B1 9EFF 8E1E FB4A  24FA B2A9 D5F3 9624 1CC2

christian

  • Guest
Re: 3.3 upgrade - dovecot allows any password from localhost (eg webmail)
« Reply #2 on: January 06, 2014, 12:21:35 am »
The nopassword=y for 127.0.0.1 has been added on purpose within the context of openchange module implementation ....

 :o :o :o

Ouch  :'(

At least it really clarifies Zentyal strategy putting OpenChange as a key component but introducing on purpose such weakness looks strange, at least to me  :-\
Workaround avoids to expose this threat through (Zentyal) RoundCube but it still exists  ::)
Any local application that will implement IMAP library will suffer from it until one configures it to not use localhost... better run your application outside instead of Zentyal server.

If this is a real technical constraint then it is definitely worth to inform users before they expose mailboxes  ;)

jkerihuel

  • Zentyal Staff
  • Zen Warrior
  • *****
  • Posts: 152
  • Karma: +18/-3
    • View Profile
Re: 3.3 upgrade - dovecot allows any password from localhost (eg webmail)
« Reply #3 on: January 06, 2014, 03:18:54 am »
Workaround avoids to expose this threat through (Zentyal) RoundCube but it still exists  ::)

Hi Christian,

The static passdb option with nopassword=y should only be depending on openchange module installation. If there is no Microsoft Exchange Server compatible server in the picture, there should indeed be no need for this parameter. We will fix this soon.

However, all the discussion focuses on "custom IMAP applications deployments" which is really - imho - a corner case and merely out of the scope. From Zentyal server's perspective, 127.0.0.1/32 is a trusted environment and all Zentyal modules are deployed with respect to this policy. Deploying new custom applications, moreover on an office server should always be a strict and controlled process.

Br,
Julien.
Twitter: http://twitter.com/jkerihuel
Key fingerprint = 08BA 50B1 9EFF 8E1E FB4A  24FA B2A9 D5F3 9624 1CC2

christian

  • Guest
Re: 3.3 upgrade - dovecot allows any password from localhost (eg webmail)
« Reply #4 on: January 06, 2014, 09:26:47 am »
The static passdb option with nopassword=y should only be depending on openchange module installation. If there is no Microsoft Exchange Server compatible server in the picture, there should indeed be no need for this parameter. We will fix this soon.

cool  :)

Quote
From Zentyal server's perspective, 127.0.0.1/32 is a trusted environment and all Zentyal modules are deployed with respect to this policy. Deploying new custom applications, moreover on an office server should always be a strict and controlled process

I see your point but this is where our views differ slightly  ;)
To me, either Zentyal server provides everything (in term of infrastructure and application) needed by organization deploying such solution or it has to be either open to external application or safely support installation of third-party software on same (Zentyal) server.

Of course, in case of installation of third-party software, it has to be done carefully but does it mean that one has to perform huge reverse engineering in order to identify such kind of weakness ?  I don't think so.

Although this is perhaps not the right place neither the right time to discuss this, I'd like to elaborate a bit, not on the technical detail (furthermore you will fix it) but on the global strategy (no I do not aim at challenging your choices  :-[ but only explain where I'm not comfortable with).
As written above, either Zentyal provides exhaustive platform (and we all know this is not achievable) or it has to support additional software.
The initial concept ("all-in-one-box" for SMB) is extended to larger organizations with add of features like GPO support or exchange server emulation. So far so good but on the other hand, there is no sign or clear evidence, unless I missed something, that Zentyal will provide associated features that are mandatory (from my standpoint) for larger deployments: multi-site support, redundancy and high availability, easy third-party or external application deployment, true use of IAM in Zentyal components.

I do understand everything can't be added in one single easy step  8)  but I feel that each step with new releases is moving toward design that is less open, more proprietary (à la Microsoft) while I also can't see any announcement describing what will be done on middle or long term to change it. I perhaps do not look at the right place  ???

E.g. I've noticed that HAproxy will be part of next releases. So far so good, I'm really fan of such kind of component  ;D but, as there is a but, I can't see how this will fit with Zentyal design and purpose. HAproxy acts as layer providing both high availability and/or load balancing in a reverse proxy like mode. What does it mean from Zentyal standpoint ?
- That Zentyal will act as reverse proxy platform for external applications, thus acting more like infrastructure gateway (which makes sense while targeting medium to large organizations) but then lack of Zentyal high availability features and openness to external applications will make it kind of useless.
- That Zentyal will provide embedded reverse proxy for embedded web servers. Cool but current vhost management features make it quite painful when it comes to do anything more than basic web pages without access control or profiling.
- one (hopefully) step toward Zentyal cluster ?

To make it short, I like HAproxy, I appreciate Zentyal willingness to add such feature but I'm frustrated by the lack of explanation (rather than "we will add such component", I'm expecting "we will add such kind of feature because this is aligned with this or that strategy") and furthermore and more critical, I fell this will make Zentyal platform even more unbalanced than before: one more step toward medium to large business support while  a lot of basic features even required for SMB are still missing.

Sorry for this long transgression  :-X

ctek

  • Zen Warrior
  • ***
  • Posts: 197
  • Karma: +6/-1
    • View Profile
Re: 3.3 upgrade - dovecot allows any password from localhost (eg webmail)
« Reply #5 on: January 06, 2014, 10:30:39 am »
After reading this I just have a go to my own server via the roundcube interface and after using a valid username I just entered a random string in pasword field and the inbox was displayed!

I confirm that this issue is also present on my system.

This is a big problem since by default the security at least should be set to use password from ldap.
I'll have to disable the roundcube service for now until this is solved, so nobody should gain access to users mailbox by just typing a random text

PS i have the 3.2 version and not the 3.3.

Bogdan

otoh

  • Zen Apprentice
  • *
  • Posts: 34
  • Karma: +1/-0
    • View Profile
Re: 3.3 upgrade - dovecot allows any password from localhost (eg webmail)
« Reply #6 on: January 06, 2014, 11:33:47 am »
The static passdb option with nopassword=y should only be depending on openchange module installation. If there is no Microsoft Exchange Server compatible server in the picture, there should indeed be no need for this parameter. We will fix this soon.

cool  :)

Likewise, cool :) Many thanks for the replies on this; it's good to know there is a reason for this change, and specifically that it will be made dependent on a module - some of us don't have Windows clients (or am I the only one?) so don't really need to get involved with exchange ;)

This is a big problem since by default the security at least should be set to use password from ldap.
I'll have to disable the roundcube service for now until this is solved, so nobody should gain access to users mailbox by just typing a random text
Bogdan

Bogdan, this can easily be fixed. You can:

  • Comment it out in /usr/share/zentyal/stubs/mail/dovecot.conf.mas and restart mail service; although note you may have to do this again after updating Zentyal
  • Or, as Julien suggested, if you change your RC server address from localhost to the actual IP address of the server machine (eg 192.168.0.100 in my case) that should resolve it.

However, it is definitely a gotcha and for now possibly deserves a sticky or something?

As an aside, I actually came across this while switching from RC to Horde. It's a very impressive bit of groupware, very configurable - a bit fiddly to set up the various bits with Zentyal but I've got it working if anyone needs help...

ctek

  • Zen Warrior
  • ***
  • Posts: 197
  • Karma: +6/-1
    • View Profile
Re: 3.3 upgrade - dovecot allows any password from localhost (eg webmail)
« Reply #7 on: January 06, 2014, 11:58:59 am »
Thank you Otoh,
I'll have to see what i'll do next since i can't set manually the ip of the server. (i'm using two lines to get to that server)
But it seems to be more close to the M$ kind of dooing things that we like it to be ("features" that are not announced but are "available" to use)...

Best regards
Bogdan

jkerihuel

  • Zentyal Staff
  • Zen Warrior
  • *****
  • Posts: 152
  • Karma: +18/-3
    • View Profile
Re: 3.3 upgrade - dovecot allows any password from localhost (eg webmail)
« Reply #8 on: January 06, 2014, 12:17:24 pm »
PS i have the 3.2 version and not the 3.3.

The updated package should be in QA and delivered through our repositories promptly. I'll double check the status with the team.

Br,
Julien.
Twitter: http://twitter.com/jkerihuel
Key fingerprint = 08BA 50B1 9EFF 8E1E FB4A  24FA B2A9 D5F3 9624 1CC2

jkerihuel

  • Zentyal Staff
  • Zen Warrior
  • *****
  • Posts: 152
  • Karma: +18/-3
    • View Profile
Re: 3.3 upgrade - dovecot allows any password from localhost (eg webmail)
« Reply #9 on: January 06, 2014, 02:17:51 pm »
The updated package should be in QA and delivered through our repositories promptly. I'll double check the status with the team.

zentyal-webmail 3.2.2 has been released.

Br,
Julien.
Twitter: http://twitter.com/jkerihuel
Key fingerprint = 08BA 50B1 9EFF 8E1E FB4A  24FA B2A9 D5F3 9624 1CC2

ctek

  • Zen Warrior
  • ***
  • Posts: 197
  • Karma: +6/-1
    • View Profile
Re: 3.3 upgrade - dovecot allows any password from localhost (eg webmail)
« Reply #10 on: January 06, 2014, 03:16:16 pm »
Thank you Julien,
I'll do an upgrade and then see if it is ok.

Best regards
Bogdan

jkerihuel

  • Zentyal Staff
  • Zen Warrior
  • *****
  • Posts: 152
  • Karma: +18/-3
    • View Profile
Re: 3.3 upgrade - dovecot allows any password from localhost (eg webmail)
« Reply #11 on: January 08, 2014, 11:27:54 am »
The nopassword=y option enabled only when openchange module is installed has been merged and new packages should be released automatically before tomorrow:

* https://github.com/Zentyal/zentyal/pull/866

Br,
Julien.
Twitter: http://twitter.com/jkerihuel
Key fingerprint = 08BA 50B1 9EFF 8E1E FB4A  24FA B2A9 D5F3 9624 1CC2

nontrivial

  • Zen Warrior
  • ***
  • Posts: 181
  • Karma: +16/-0
    • View Profile
Re: 3.3 upgrade - dovecot allows any password from localhost (eg webmail)
« Reply #12 on: January 10, 2014, 08:50:19 pm »
I second the motion to make this a sticky topic. I am using EGroupware with IMAP based authentication with Zentyal 3.2 (fully up to date), and I was just bitten by this. I took the route of editing dovecot.conf.mas.

James
PS I also vote to set mail_max_userip_connections in dovecot.conf.mas to 20 or 30 instead of the default 10 because certain IMAP clients (*cough* Outlook *cough*) don't appear to release connections in a timely manner.