1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2026-10-29 15:02:30 +00:00
Files
go-chasquid-smtp/internal
Alberto Bertogli b3a500d9e4 smtpsrv: Use SNI as hostname only if it matches one of our certs
Today, the client can give us any SNI, and still complete a valid
negotiation, which means it can be attacker-controlled (including having
problematic characters).

We use that SNI as our hostname in a variety of places, including
Received and Authentication-Results headers. This creates an
opportunity for an attacker to manipulate those headers.

To fix that problem, this patch only takes the SNI if it matches one of
our certs' hostnames. Otherwise we use the configured hostname (same as
if there was no SNI today).

Once Go 1.27 is our minimum supported version, we can simplify this
further by checking the SNI against ConnectionState.LocalCertificate.
2026-10-12 21:16:01 +01:00
..
2026-10-09 00:00:12 +01:00
2025-04-06 14:02:56 +01:00
2026-10-09 00:00:12 +01:00
2026-10-12 19:29:40 +01:00