New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MiTM] Certificates are not validated? #332

Closed
kbabioch opened this Issue Sep 28, 2014 · 23 comments

Comments

6 participants
@kbabioch

kbabioch commented Sep 28, 2014

Hi,

I'm using a self-signed certificate for my IMAP server. I could add the connection details to the list of valid domains and it just worked (TM) without asking me to add an exception and/or notifying me at all. I have not investigated this any further, but I would absolutely expect to get a warning and to have to add the root CA certificate.

@RainLoop RainLoop closed this in 49f6c8b Oct 6, 2014

@kbabioch

This comment has been minimized.

kbabioch commented Oct 6, 2014

Making this an option sound wrong to me. It should be enforced at all costs. If you really want to make this optional, you should hide it very deep within some configuration files.

People tend to click anything to make warnings and/error go away, so it should not be possible to override this setting. Using SSL/TLS without authentication is basically as bad as not using SSL/TLS at all. Most people do not realize this, so RainLoop should be really pro-active here, especially since we now know how badly broken our crypto infrastructure is in general.

@RainLoop

This comment has been minimized.

Owner

RainLoop commented Oct 7, 2014

I understand your concern.
But I'm losing backward compatibility. And it's not good, because for many users RainLoop stops working correctly.

@kbabioch

This comment has been minimized.

kbabioch commented Oct 7, 2014

So you choose backward compatibility over security, although the lack of security should be considered as a bug in the first place? Do you, by any chance, work for Microsoft ;)? Sorry, but I really do not understand your reasoning. People rely on SSL/TLS and consider it to be secure. Most people don't know the details of how it works and hence do not know anything about authentication and the possibility of MiTM attacks in case certificates are not verified. Any installation that works right now and wouldn't work after enforcing the verification is not secure and you should not trick people into thinking it to be secure. In case people _really_ know what they are doing, an option deeply burried in some configuration file would allow them to (temporarily) disable these kind of checks. At least in my opinion everything else is careless and mostly the consequence of developers not having a clue about SSL/TLS either.

@ervee

This comment has been minimized.

Contributor

ervee commented Oct 7, 2014

I'm with john on this one. If anyone uses, say, self signed certificates with his own IMAP Server, he/she shuold also be able to trust this certificate/root ca on the RainLoop system, if not the same.

For all other setups, RainLoop should deny or throw an error if connecting to, say Google, with an invalid certificate. IMHO there should not be a GUI option to disable certificate verification. Perhaps a debug option in application.ini, but not in the GUI.

@RainLoop RainLoop reopened this Oct 7, 2014

@RainLoop

This comment has been minimized.

Owner

RainLoop commented Oct 7, 2014

Okay, it will be application.ini labs setting.

RainLoop added a commit that referenced this issue Oct 7, 2014

Removed "Verify ssl certificate" setting (#332)
Added global "labs.verify_ssl_certificate" settings (default:true) (#332)
Fixed php notices
@AndrewSav

This comment has been minimized.

Contributor

AndrewSav commented Oct 8, 2014

Is it on or off by default?

@kbabioch

This comment has been minimized.

kbabioch commented Oct 8, 2014

@AndrewSav The commit message mentions it already, because it contains the string "default:true".

@RainLoop

This comment has been minimized.

Owner

RainLoop commented Oct 9, 2014

Next commit message is "verify_ssl_certificates = false"

Unfortunately too many people have written me about connection problems in the webmail.
So I decided to disable this functionality by default.
In fact, even my server (PHP 5.4) can't validate gmail.com.
And I need more time to understand the reason.

However on a server with PHP5.6 everything works fine.
But I can't force people to update php or something like that. They will not to do that.

@ervee

This comment has been minimized.

Contributor

ervee commented Oct 9, 2014

I have PHP 5.4.4 and it throws a "Cannot enable STARTTLS" message when I want to send an email with enable verify_ssl_certificates = on.
I use Sendmail with "official" Certificates and I connect SMTP to the correct CN (so not localhost) , so why this fails... beats me... Perhaps php does not have (access to) Root CA's files?

I have log which might point you in the right direction if you want. But you probably have the same log ;-) I'll send it to you, discard it if you don't need it.

Ralf.

@RainLoop

This comment has been minimized.

Owner

RainLoop commented Oct 9, 2014

Thanks

@kbabioch

This comment has been minimized.

kbabioch commented Oct 10, 2014

@RainLoop

I'm all for investigating the problem and trying to find out what the issue is.

BUT: Right now all of the installations that do work without validation, but don't work with validation enabled are vulnerable to Man-in-the-Middle attacks. I'm pretty sure that most of the users do NOT realize that. SSL/TLS without verification is pretty much useless. A lot of applications and developers had to find this out the hard way. Don't be one of them.

SSL/TLS verification needs to be enabled by default. Everything else is just batshit crazy and has nothing to do with security at all. You need to make people aware of the fact that their installation is unsecure. If they then wish to proceed, its their own fault. But don't make your product insecure by design.

RainLoop referenced this issue Oct 10, 2014

@ismail

This comment has been minimized.

ismail commented Oct 10, 2014

Well currently this is a huge security bug. You must verify SSL certificates by default no matter what.

@AndrewSav

This comment has been minimized.

Contributor

AndrewSav commented Oct 10, 2014

I agree that it should be on by default, and that the next version should actually break the installation for those not using proper certs (with an option to turn the check off if they are so inclined).
But from commercial and PR perspective pushing a version that breaks a good deal of your customer base is not always a good option. So I'm guessing he has to balance that.

@kbabioch

This comment has been minimized.

kbabioch commented Oct 16, 2014

No, I don't see what and how your issue is linked with this one. We are talking about something fundamental here, nothing that can be fixed by clearing a cache folder?

@kbabioch

This comment has been minimized.

kbabioch commented Nov 18, 2014

Bump. Will this be further addressed? What is the solution?

@kbabioch

This comment has been minimized.

kbabioch commented Dec 9, 2014

Ping. Is this really prioritized so low? At least for me this is absolutely vital and a showstopper.

@ervee

This comment has been minimized.

Contributor

ervee commented Dec 9, 2014

Why is this a showstopper for you? Make sure your PHP is >5.6 and set 'verify_ssl_certificates = on' in application.ini and you're done.

@kbabioch

This comment has been minimized.

kbabioch commented Dec 9, 2014

Because knowing that the main developer seems not to be interested in resolving security related issues gives me a fuzzy feeling. Not verifying the certificates at all is bad enough when it happens by accident, but knowingly allowing this makes it even worse.

@RainLoop

This comment has been minimized.

Owner

RainLoop commented Dec 9, 2014

the main developer seems not to be interested

But I can't FIX this problem.

@kbabioch

This comment has been minimized.

kbabioch commented Dec 19, 2014

You can fix this problem by enforcing proper certificate validation on your end, i.e. within rainloop. It is up to upstream to figure out the issues within PHP and/or openssl.

@lakano

This comment has been minimized.

lakano commented Aug 26, 2015

Hello,

May be this could help, there is some informations about significant changes since PHP 5.6 on the TLS streams:
http://php.net/manual/en/migration56.incompatible.php

Currently, I'm under PHP 5.5.9 ( Ubuntu Server, packagers explain they will not upgrade to php 5.6 because of backward incompatibilities )

I'm trying to use RainLoop inside OwnCloud 8.1, I can't connect to my own mail server with a self-signed cert.

May be I need to upgrade to PHP 5.6, but I'm afraid of the backward compatibility with OwnCloud and all 3rd party applications installed.

Regards,

@RainLoop

This comment has been minimized.

Owner

RainLoop commented Aug 26, 2015

Well, I have added some additional configurations in application.ini that can help.

[ssl]
; Location of Certificate Authority file on local filesystem (/etc/ssl/certs/ca-certificates.crt)
cafile = "" 
; capath must be a correctly hashed certificate directory. (/etc/ssl/certs/)
capath = ""
@lakano

This comment has been minimized.

lakano commented Aug 26, 2015

👍
BTW, I'm testing with PHP 5.6 (from an external source)... same problem with my self-signed certs.
But I have updated by certs with one from StartSSL (free), now it's works.

@RainLoop RainLoop closed this Sep 18, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment