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

No certificate verification #142

Closed
asentieri opened this issue Nov 25, 2016 · 9 comments
Closed

No certificate verification #142

asentieri opened this issue Nov 25, 2016 · 9 comments

Comments

@asentieri
Copy link

Apparently imapfilter is not checking the certificate after connecting to the imap server, or I am missing something. If the DNS is compromised by some hacker and imapfilter is directed to a fake IP address, the certificate supplied by that IP address will be accepted as valid if it is properly signed. What I mean is that if imapfilter is expecting to connect to imap.xyz... and the server signed and valid certificate is from www.abc..., the connection will go through even if that is not the expected server. Apparently you have to use a SSL validate callback to solve that (SSL_CTX_set_verify)

@Papafox
Copy link

Papafox commented Nov 26, 2016 via email

@asentieri
Copy link
Author

asentieri commented Nov 26, 2016 via email

@Papafox
Copy link

Papafox commented Nov 28, 2016 via email

@SA0TAY
Copy link

SA0TAY commented Sep 7, 2019

Friendly reminder that this is still an issue, and a pretty big one at that. All an intercepting attacker would need to do is to have a valid signed certificate for any domain, and imapfilter will happily accept it.

Luckily, I think the fix is pretty simple. A few additional lines in cert.c ought to do it: https://wiki.openssl.org/index.php/Hostname_validation

@hiqua
Copy link

hiqua commented Sep 7, 2019

@lefcha any chance you could look at it?

@carnil
Copy link

carnil commented Sep 8, 2019

MITRE has assigned CVE-2016-10937 for this issue.

@lefcha
Copy link
Owner

lefcha commented Sep 15, 2019

Just pushed a commit that should add support for hostname validation: bf2515d

It should work with OpenSSL 1.1.0 and later as described in the OpenSSL's Hostname validation page.

From my simple tests it seems to work. Please give it a try and let me know how it works for you. Thanks!

@hiqua
Copy link

hiqua commented Sep 16, 2019

@lefcha this seems to work for me in the case mentioned earlier in this thread, thanks!

@lefcha
Copy link
Owner

lefcha commented Sep 16, 2019

Great, thanks @hiqua!

Just added support for hostname validation with OpenSSL 1.0.2 and later, too: 3daa269

Also released v2.6.13.

@lefcha lefcha closed this as completed Sep 16, 2019
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

6 participants