`smtps://` email connection string without a port connects to port 25 with no TLS
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
Hướng nghiên cứu
Bắt đầu với src/Exceptionless.Core/Utility/SmtpUri.cs và src/Exceptionless.Core/Configuration/EmailOptions.cs, sau đó lần theo cách tùy chọn mã hóa được tạo ra truyền đến MailKitMailSender. Bổ sung kiểm thử cho smtp://host, smtps://host và smtps://host:587 như mô tả, rồi chạy các kiểm thử liên quan. Hoàn tất khi URI smtps vẫn giữ truyền tải an toàn và chọn đúng cổng cùng chế độ TLS như mong đợi.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
SmtpUri sets port 465 for an smtps:// URI with no explicit port, then overwrites it with 25 a few lines later. Because the encryption default is derived from the port, the mailer then connects to port 25 with no TLS. The parsed IsSecure flag is never used.
Where
SmtpUriconstructor setsPort = uri.IsDefaultPort ? 465 : uri.Portforsmtps, then L41 unconditionally runsPort = uri.IsDefaultPort ? 25 : uri.Port.System.Urihas no default port forsmtps, soIsDefaultPortistrueandPortis-1whenever the port is omitted.EmailOptions.ReadFromConfigurationcopies host, port, user and password but notIsSecure, and defaultsSmtpEncryptionfrom the port viaGetDefaultSmtpEncryption(25 maps toNone).MailKitMailSenderconnects withSecureSocketOptions.Noneand then authenticates.
Steps to reproduce
- Set
EX_ConnectionStrings__Email=smtps://user:[email protected](no port) and leaveEX_SmtpEncryptionunset. - Trigger any email (e.g. a password reset). The mailer connects to
smtp.example.com:25without TLS and sendsAUTHwith the credentials in the clear, or fails if port 25 is blocked or the server requires TLS.
Expected
smtps://host connects to port 465 with implicit TLS (SslOnConnect). More generally, the smtps scheme should select TLS regardless of port.
Suggested fix
Remove the trailing Port = uri.IsDefaultPort ? 25 : uri.Port; in SmtpUri (the scheme branches already set the port). In EmailOptions, when SmtpEncryption isn't configured and uri.IsSecure is true, default to SSL for port 465 and StartTLS for other ports instead of None. Add SmtpUri tests for smtp://host, smtps://host, and smtps://host:587.
- Ngôn ngữ chính
- C#
- Star
- 2.5k
- Fork
- 508
- Merge trung bình
- 2 ngày 17 giờ
- Pull request đã merge (30 ngày)
- 40
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của exceptionless/Exceptionless
-
bug documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
exceptionless/Exceptionless#2707 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
exceptionless/Exceptionless#2706 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
exceptionless/Exceptionless#2705 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
exceptionless/Exceptionless#2704 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
exceptionless/Exceptionless#2703 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của exceptionless/Exceptionless
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Исправить опечатки в протоколеĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 76/100
GameShowLDA/AskMkiM#1075 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
kind/bug triage/untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
unoplatform/uno.resizetizer#414 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày