Skip to content
This repository was archived by the owner on Nov 28, 2024. It is now read-only.

[SECURITY] Option to enforce STARTTLS #23

Closed
@sfllaw

Description

@sfllaw

mail/smtp.go

Lines 98 to 105 in 1e5036a

if !d.SSL {
if ok, _ := c.Extension("STARTTLS"); ok {
if err := c.StartTLS(d.tlsConfig()); err != nil {
c.Close()
return nil, err
}
}
}

This code only tries to upgrade to a TLS connection if the server reports that it supports the STARTTLS extension. If an attacker intercepts the SMTP connection and responds that the extension is unknown, then they can prevent TLS from being turned on.

It would be backwards incompatible to expect STARTTLS by default, but we can make an option that would enforce a STARTTLS connection.

Of course, if the connection is already protected by SSL, then STARTTLS is unnecessary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions