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

Aperta
#5,986 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
54/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
php

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
PHP
Stelle
1.2k
Fork
932
Merge medio
1g 11h
PR unite (30g)
22

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di opnsense/plugins

Tutte le issue di opnsense/plugins

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.