You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
[FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
Please do not modify this template :) and fill in all the required fields.
1. Is this request related to a challenge you're experiencing? Tell me about your story.
Description
The current implementation for SMTP communication using TLS (smtplib.SMTP with starttls()) does not enforce a minimum TLS version. This can potentially expose the application to vulnerabilities if older, insecure TLS versions are negotiated.
Code Location
The relevant code snippet is located in /api/libs/smtp.py, line 22 to 29 for v0.15.2
To enhance security and follow best practices, we should explicitly set a minimum TLS version when using starttls(). Specifically, we should enforce TLS v1.2 or higher to avoid insecure protocols.
This change will improve security by ensuring that only secure TLS versions are used.
It should not impact functionality, as most modern servers support TLS v1.2 or higher. However, you may need to review your mail server configuration if you experience issues.
Additional Context
The proposed change uses ssl.create_default_context() to get a default secure context.
It then sets minimum_version to ssl.TLSVersion.TLSv1_2, forcing the connection to use TLS v1.2 or higher.
Benefits
Mitigates potential security risks associated with older TLS versions.
Aligns with modern security standards.
I am happy to submit a pull request that implements this change.
My email server uses Google Workspace's email service. Without making the necessary changes, it will be impossible to connect to Google's email service.
3. Can you help us with this feature?
I am interested in contributing to this feature.
The text was updated successfully, but these errors were encountered:
Self Checks
1. Is this request related to a challenge you're experiencing? Tell me about your story.
The current implementation for SMTP communication using TLS (smtplib.SMTP with starttls()) does not enforce a minimum TLS version. This can potentially expose the application to vulnerabilities if older, insecure TLS versions are negotiated.
The relevant code snippet is located in /api/libs/smtp.py, line 22 to 29 for v0.15.2
To enhance security and follow best practices, we should explicitly set a minimum TLS version when using starttls(). Specifically, we should enforce TLS v1.2 or higher to avoid insecure protocols.
The code should be changed to:
This change will improve security by ensuring that only secure TLS versions are used.
It should not impact functionality, as most modern servers support TLS v1.2 or higher. However, you may need to review your mail server configuration if you experience issues.
The proposed change uses ssl.create_default_context() to get a default secure context.
It then sets minimum_version to ssl.TLSVersion.TLSv1_2, forcing the connection to use TLS v1.2 or higher.
Mitigates potential security risks associated with older TLS versions.
Aligns with modern security standards.
I am happy to submit a pull request that implements this change.
2. Additional context or comments
In Node.js, the code like following:
My email server uses Google Workspace's email service. Without making the necessary changes, it will be impossible to connect to Google's email service.
3. Can you help us with this feature?
The text was updated successfully, but these errors were encountered: