Skip to content
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

SSL/TLS certificates are not validated! #68

Closed
dmth opened this issue May 30, 2016 · 1 comment
Closed

SSL/TLS certificates are not validated! #68

dmth opened this issue May 30, 2016 · 1 comment

Comments

@dmth
Copy link
Contributor

dmth commented May 30, 2016

Hi Folks,

from my Impression current imbox does not validate SSL/TLS certificates.

https://github.com/martinrusev/imbox/blob/master/imbox/imap.py#L21

calls IMAP4_SSL default constructor which looks like:

imaplib.IMAP4_SSL(host='', port=IMAP4_SSL_PORT, keyfile=None, certfile=None, ssl_context=None)

As you can see at ssl_context=None. This default configuration does not validate SSL/TLS certificates!

Using the default configuration makes software using Imbox vulnerable!

Idea to solve this problem (untested sketch code!)

import ssl as pythonssllib

       if ssl:
            context = pythonssllib.create_default_context()
            if not self.port:
                self.port = 993
            self.server = self.IMAP4_SSL(self.hostname, self.port, ssl_context=context)
        else:
            if not self.port:
                self.port = 143
            self.server = self.IMAP4(self.hostname, self.port)     

Issuetrace: certtools/intelmq#532

dmth pushed a commit to Intevation/imbox that referenced this issue Jun 2, 2016
software was altered, in order to use the systems SSL-Context as
default.

It allows to toggle the use of the SSL-Default Context. It does not
allow to use a custom context.

 Considerations:
 * If No SSL-Validation should be done, the ImboxClass should be adapted, in
   order to achieve configuration of the ssl-context. This commit does not
   contain this alteration.

 Other Changes:
 * Reformatted long lines
@ghost
Copy link

ghost commented Jan 18, 2017

I think this can be closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants