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

未关闭
#5,986 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
54/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
php

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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

主要语言
PHP
星标
1.2k
派生
932
平均合并
1 天 11 小时
30 天内合并 PR
22

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

opnsense/plugins 的其他 Issue

查看 opnsense/plugins 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。