A new SMTP-protocol level spoofing attack was recently published:
https://sec-consult.com/blog/detail/smtp-smuggling-spoofing-e-mails-worldwide/
Proxmox Mailgateway uses postfix as it's mail transport agent, thus the fix for the vulnerability happens in postfix.
postfix upstream details: https://www.postfix.org/smtp-smuggling.html
pmg-api in version 8.0.11 and 7.3-11 respectively address the issue by not accepting bare newlines and rejecting pipelineing on the external port by setting:
in the main.cf.in template (
and removing both restriction on the internal port in the master.cf.in template (
The long-term fix using
The stable-update repositories are enabled by default on installs from the PMG ISO and from the container-template.
If you have modified the postfix configuration templates make sure to adapt them to include those lines. The package installation procedure
will ask you about changes in the shipped config-files, since the configuration templates are handled with
After updating you can verify that the necessary configuration item has been set as follows:
The expected output is:
The mitigation is limited to the external port in order to minimize issues with internal trusted hosts, which do not adhere to the SMTP protocol.
If your environment does not have such hosts removing the modification for the
Using
have one consistent fix for both supported PMG releases (7.3 and 8.0).
The packages containing the fix are available on all repositories - the version forbiding bare newlines is available in the pmg-no-subscription repositories.
UPDATE: postfix upstream has addressed the issue by providing an option to forbid bare newlines ('\n' instead of '\r\n') as command separator.
Once this change has been backported to the versions available in Debian and been released, we will provide a further update enabling this option on the external port. The Mail Proxy Whitelist (https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#pmgconfig_whitelist_overview) can optionally list exceptions for external hosts that do not adhere to the SMTP protocol.
UPDATE (02.01.2024): the packages which have an option to forbid bare newlines as command separator are available in the bookworm-updates and bullseye-updates Debian repositories - pmg-api 8.0.11 contains updated postfix configuration templates that turn this option on for the external port, and allow clients listed in the mail proxy whitelist to still send bare newlines. An updated version for PMG 7.3 will follow in the next days.
UPDATE (10.01.2024): the text was updated to reflect that PMG 7 and 8 now use the long-term fix, as the both versions are available in the respective pmg-no-subscription repositories
https://sec-consult.com/blog/detail/smtp-smuggling-spoofing-e-mails-worldwide/
Proxmox Mailgateway uses postfix as it's mail transport agent, thus the fix for the vulnerability happens in postfix.
postfix upstream details: https://www.postfix.org/smtp-smuggling.html
pmg-api in version 8.0.11 and 7.3-11 respectively address the issue by not accepting bare newlines and rejecting pipelineing on the external port by setting:
Code:
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_forbid_bare_newline = yes
smtpd_forbid_bare_newline_exclusions =
$mynetworks,
cidr:/etc/postfix/clientaccess
/var/lib/pmg/templates/main.cf.in
)and removing both restriction on the internal port in the master.cf.in template (
/var/lib/pmg/templates/master.cf.in
).The long-term fix using
smtpd_forbid_bare_newline = yes
is needs the postfix packages in the bookworm-update
or bullseye-update
(see https://wiki.debian.org/StableUpdates) repositories respectively.The stable-update repositories are enabled by default on installs from the PMG ISO and from the container-template.
If you have modified the postfix configuration templates make sure to adapt them to include those lines. The package installation procedure
will ask you about changes in the shipped config-files, since the configuration templates are handled with
ucf
(see https://packages.debian.org/bookworm/ucf)After updating you can verify that the necessary configuration item has been set as follows:
Code:
# grep -E 'smtpd_data_restrictions|smtpd_forbid_bare_newline' /etc/postfix/main.cf /etc/postfix/master.cf
Code:
/etc/postfix/main.cf:smtpd_data_restrictions = reject_unauth_pipelining
/etc/postfix/main.cf:smtpd_forbid_bare_newline = yes
/etc/postfix/main.cf:smtpd_forbid_bare_newline_exclusions =
/etc/postfix/master.cf: -o smtpd_data_restrictions=
/etc/postfix/master.cf: -o smtpd_forbid_bare_newline=no
The mitigation is limited to the external port in order to minimize issues with internal trusted hosts, which do not adhere to the SMTP protocol.
If your environment does not have such hosts removing the modification for the
master.cf.in
template (by copying it to /etc/pmg/templates
will disable pipelining and accepting bare linefeeds also on the internal port.Using
smtpd_data_restrictions = reject_unauth_pipelining
instead of the alternative smtpd_forbid_unauth_pipelining = yes
was chosen tohave one consistent fix for both supported PMG releases (7.3 and 8.0).
The packages containing the fix are available on all repositories - the version forbiding bare newlines is available in the pmg-no-subscription repositories.
UPDATE: postfix upstream has addressed the issue by providing an option to forbid bare newlines ('\n' instead of '\r\n') as command separator.
Once this change has been backported to the versions available in Debian and been released, we will provide a further update enabling this option on the external port. The Mail Proxy Whitelist (https://pmg.proxmox.com/pmg-docs/pmg-admin-guide.html#pmgconfig_whitelist_overview) can optionally list exceptions for external hosts that do not adhere to the SMTP protocol.
UPDATE (02.01.2024): the packages which have an option to forbid bare newlines as command separator are available in the bookworm-updates and bullseye-updates Debian repositories - pmg-api 8.0.11 contains updated postfix configuration templates that turn this option on for the external port, and allow clients listed in the mail proxy whitelist to still send bare newlines. An updated version for PMG 7.3 will follow in the next days.
UPDATE (10.01.2024): the text was updated to reflect that PMG 7 and 8 now use the long-term fix, as the both versions are available in the respective pmg-no-subscription repositories
Last edited: