OfflineIMAP / offlineimap

Read/sync your IMAP mailboxes (python2) [LEGACY: move to offlineimap3]
http://www.offlineimap.org
Other
1.78k stars 361 forks source link

Does not check SSL Certificate Revocation Status #548

Open velleto opened 6 years ago

velleto commented 6 years ago

General informations

OfflineIMAP still syncs with mail server, even if their SSL certificate has been revoked. I realise that this may expected behavior, or be the fault of my poor configuration of SSL features (below).

I stumbled across this, when my university changed their certificates and had revoked ones online for a short maintenance time frame. When the new ones were installed, OfflineIMAP refused to connect, as the fingerprint had changed (as expected and documented).

Configuration file offlineimaprc

[general]

metadata = somepath/metadata
pythonfile = somepath/offlineimap.py

accounts = email

[Account email]
localrepository     = email-local
remoterepository    = email-remote

[Repository email-local]
type                = Maildir
localfolders        = somepath/myemail@domain.tld/mailbox

[Repository email-remote]
type                = IMAP
remotehost          = mail.domain.tld
remoteuser          = myemail
remotepasseval      = keychain("myemail@domain.tld")

ssl                 = yes
sslcacertfile       = /etc/ssl/certs/ca-certificates.crt
cert_fingerprint    = 21987e2442191dc606f25fdfc7dce6091416b74a

maxconnections      = 3
holdconnectionopen  = true
createfolders       = false

pythonfile (if any)

Irrelevant to issue.

Logs, error

None.

Steps to reproduce the error

nicolas33 commented 6 years ago

We won't check for the SSL validity when using the cert_fingerprint of the certificate. Certificate validation is done with the sslcacertfile option.

See https://github.com/OfflineIMAP/offlineimap/blob/master/offlineimap.conf#L748

chris001 commented 6 years ago

This is an interesting security issue.

velleto commented 6 years ago

@nicolas33

We won't check for the SSL validity when using the cert_fingerprint of the certificate. Certificate validation is done with the sslcacertfile option.

In that same configuration file it states that:

https://github.com/OfflineIMAP/offlineimap/blob/88197a7e9097a3774aa328c110d9a6692d4cf465/offlineimap.conf#L781-L784

I understand this to mean that: first the certificate will be verified, and then the fingerprint checked, returning an error if either fails. I have configured the sslcacertfile and cert_fingerprint. Have I done so incorrectly, or have I misunderstood the excerpt above? If there has been a misunderstanding, I would suggest changing that wording to be less ambiguous.