mail/postfix: Missing TLS certificate verification for upstream SMTP authentication

Đang mở
#5,986 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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ó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
54/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
php
Lĩnh vực
authentication, security

Hướng nghiên cứu

Start with the Postfix model at mail/postfix/src/opnsense/mvc/app/models/OPNsense/Postfix/General.xml and the main.cf template at mail/postfix/src/opnsense/service/templates/OPNsense/Postfix/main.cf. Check how TLS security levels and SMTP authentication settings are exposed and generated, then compare them with the Postfix TLS and SASL requirements cited in the issue. Done means the plugin provides authenticated TLS options and handles upstream authentication consistently with those requirements.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Important notices
Before you add a new report, we ask you kindly to acknowledge the following:

Describe the bug

First off, thanks for all the great work! This is more of a security-relevant configuration limitation than a bug.

I was about to set up the Postfix plugin (for the first time), but noticed it currently exposes only none, may, encrypt and dane as SMTP client TLS security levels. See here.

The encrypt security level requires encryption but does not require successful certificate or hostname verification. When SMTP authentication is enabled, this can expose SMTP credentials to an active man-in-the-middle attacker.

Enabling TLS without server authentication is not sufficiently secure in this context. See postfix docs.

Even though TLS encryption is always used, mail delivery continues even if the server certificate is untrusted or bears the wrong name.

The plugin's main.cf template also clears smtp_sasl_security_options when upstream SMTP authentication is enabled, allowing plaintext authentication mechanisms such as SASL PLAIN.

Using SASL PLAIN with the encrypt security level is at odds with RFC 4954, Section 14, which requires successful server certificate and hostname verification before authentication. See RFC4954.

If the server has not provided any certificate, or if the certificate verification fails, the client MUST NOT attempt to authenticate using the SASL PLAIN mechanism.

I didn't try to override the config because this open issue reports that modifications to the main.cf template are overwritten on every upgrade.

Please consider exposing the verify and secure TLS security levels and enforcing or recommending authenticated TLS when upstream SMTP authentication is enabled. This would protect SMTP credentials against server impersonation.

Additional context

This report is based on looking for the option, followed by source-code inspection and the documented behavior of Postfix. I have not reproduced credential disclosure in a live environment.

Environment

OPNsense 26.7.10

Ngôn ngữ chính
PHP
Star
1.2k
Fork
932
Merge trung bình
1 ngày 11 giờ
Pull request đã merge (30 ngày)
22

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của opnsense/plugins

Tất cả issue của opnsense/plugins

Issue tương tự

Thêm issue về PHP

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.