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

TLS is not properly enforced for IMAP connections #233

Closed
mpurg opened this issue Mar 22, 2024 · 2 comments · Fixed by #235
Closed

TLS is not properly enforced for IMAP connections #233

mpurg opened this issue Mar 22, 2024 · 2 comments · Fixed by #235

Comments

@mpurg
Copy link

mpurg commented Mar 22, 2024

In function get_imap_port(), if IO::Socket::SSL is not available TLS will be disabled with only a warning:

carp "no SSL, using insecure connection: $!\n";

Considering that in this case the credentials are sent in plain text, it might be better to change the default behavior to fail. The user could opt-in via a configuration option (e.g. allow_insecure_imap).

In the same function, the verification of server certificates is disabled if Mozilla::CA is not available. This largely defeats the purpose of using TLS, making it succeptible to MITM attacks. Please consider using the defaults provided by IO::Socket::SSL, as recommended here: https://metacpan.org/pod/IO::Socket::SSL#Common-Usage-Errors

@msimerson
Copy link
Owner

I'm thinking:

  1. make port detection explicit and default to 993. The only way to get a port 143 connection is to ask for it.
  2. add a SSL_verify_mode setting in the config, for users that need it.

@mpurg
Copy link
Author

mpurg commented Mar 26, 2024

Sounds good, thanks for the prompt response!

msimerson added a commit that referenced this issue May 31, 2024
imap: add SSL_verify_mode config setting to disable TLS host validation, fixes #233
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants