<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc SYSTEM 'rfc2629.dtd' []>
<rfc ipr="trust200902" category="std" docName="draft-margolis-smtp-sts-00">
<?rfc toc="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<?rfc private=""?>
<?rfc topblock="yes"?>
<?rfc comments="no"?>
<front>
<title abbrev="SMTP-STS">SMTP Strict Transport Security</title>

<author initials="D." surname="Margolis" fullname="Daniel Margolis">
<organization>Google, Inc</organization>
<address>
<postal>
<street></street>
<city></city>
<code></code>
<country></country>
<region></region>
</postal>
<phone></phone>
<email>dmargolis (at) google.com</email>
<uri></uri>
</address>
</author>
<author initials="M." surname="Risher" fullname="Mark Risher">
<organization>Google, Inc</organization>
<address>
<postal>
<street></street>
<city></city>
<code></code>
<country></country>
<region></region>
</postal>
<phone></phone>
<email>risher (at) google (dot com)</email>
<uri></uri>
</address>
</author>
<author initials="N." surname="Lidzborski" fullname="Nicolas Lidzborski">
<organization>Google, Inc</organization>
<address>
<postal>
<street></street>
<city></city>
<code></code>
<country></country>
<region></region>
</postal>
<phone></phone>
<email>nlidz (at) google (dot com)</email>
<uri></uri>
</address>
</author>
<author initials="W." surname="Chuang" fullname="Wei Chuang">
<organization>Google, Inc</organization>
<address>
<postal>
<street></street>
<city></city>
<code></code>
<country></country>
<region></region>
</postal>
<phone></phone>
<email>weihaw (at) google (dot com)</email>
<uri></uri>
</address>
</author>
<author initials="B." surname="Long" fullname="Brandon Long">
<organization>Google, Inc</organization>
<address>
<postal>
<street></street>
<city></city>
<code></code>
<country></country>
<region></region>
</postal>
<phone></phone>
<email>blong (at) google (dot com)</email>
<uri></uri>
</address>
</author>
<author initials="B." surname="Ramakrishnan" fullname="Binu Ramakrishnan">
<organization>Yahoo!, Inc</organization>
<address>
<postal>
<street></street>
<city></city>
<code></code>
<country></country>
<region></region>
</postal>
<phone></phone>
<email>rbinu (at) yahoo-inc (dot com)</email>
<uri></uri>
</address>
</author>
<author initials="A." surname="Brotman" fullname="Alexander Brotman">
<organization>Comcast, Inc</organization>
<address>
<postal>
<street></street>
<city></city>
<code></code>
<country></country>
<region></region>
</postal>
<phone></phone>
<email>alexander_brotman (at) cable.comcast (dot com)</email>
<uri></uri>
</address>
</author>
<author initials="J." surname="Jones" fullname="Janet Jones">
<organization>Microsoft, Inc</organization>
<address>
<postal>
<street></street>
<city></city>
<code></code>
<country></country>
<region></region>
</postal>
<phone></phone>
<email>janet.jones (at) microsoft (dot com)</email>
<uri></uri>
</address>
</author>
<author initials="F." surname="Martin" fullname="Franck Martin">
<organization>LinkedIn</organization>
<address>
<postal>
<street></street>
<city></city>
<code></code>
<country></country>
<region></region>
</postal>
<phone></phone>
<email>fmartin (at) linkedin (dot com)</email>
<uri></uri>
</address>
</author>
<author initials="K." surname="Umbach" fullname="Klaus Umbach">
<organization>1&amp;1 Mail &amp; Media Development &amp; Technology GmbH</organization>
<address>
<postal>
<street></street>
<city></city>
<code></code>
<country></country>
<region></region>
</postal>
<phone></phone>
<email>klaus.umbach (at) 1und1 (dot de)</email>
<uri></uri>
</address>
</author>
<author initials="M." surname="Laber" fullname="Markus Laber">
<organization>1&amp;1 Mail &amp; Media Development &amp; Technology GmbH</organization>
<address>
<postal>
<street></street>
<city></city>
<code></code>
<country></country>
<region></region>
</postal>
<phone></phone>
<email>markus.laber (at) 1und1 (dot de)</email>
<uri></uri>
</address>
</author>
<date year="2016" month="March" day="18"/>

<area>Applications</area>
<workgroup>Using TLS in Applications</workgroup>
<keyword></keyword>


<abstract>
<t>SMTP STS is a mechanism enabling mail service providers to declare their ability
to receive TLS-secured connections, to declare particular methods for
certificate validation, and to request sending SMTP servers to report upon
and/or refuse to deliver messages that cannot be delivered securely.
</t>
</abstract>


</front>

<middle>

<section anchor="introduction" title="Introduction">
<t>The STARTTLS extension to SMTP <xref target="RFC3207"/> allows SMTP clients and hosts to
establish secure SMTP sessions over TLS. In its current form, however, it fails
to provide (a) message confidentiality — because opportunistic STARTTLS is
subject to downgrade attacks — and (b) server authenticity — because the trust
relationship from email domain to MTA server identity is not cryptographically
validated.
</t>
<t>While such &quot;opportunistic&quot; encryption protocols provide a high barrier against
passive man-in-the-middle traffic interception, any attacker who can delete
parts of the SMTP session (such as the &quot;250 STARTTLS&quot; response) or who can
redirect the entire SMTP session (perhaps by overwriting the resolved MX record
of the delivery domain) can perform such a downgrade or interception attack.
</t>
<t>This document defines a mechanism for recipient domains to publish policies
specifying:
</t>
<t>
<list style="symbols">
<t>whether MTAs sending mail to this domain can expect TLS support</t>
<t>how MTAs can validate the TLS server certificate presented during mail
 delivery</t>
<t>what an implementing sender should do with messages when TLS cannot be be
 successfully negotiated</t>
</list>
</t>
<t>The mechanism described is separated into four logical components:
</t>
<t>
<list style="numbers">
<t>policy semantics: whether senders can expect a server for the
  recipient domain to support TLS encryption and how to validate the TLS
  certificate presented</t>
<t>policy authentication: how to determine the authenticity of a published
  policy delivered via DNS</t>
<t>failure report format: a mechanism for informing recipient domains about
  aggregate failure statistics</t>
<t>failure handling: what sending MTAs should do in the case of policy
  failures</t>
</list>
</t>

<section anchor="terminology" title="Terminology">
<t>The keywords MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT,
SHOULD, SHOULD NOT, RECOMMENDED, MAY, and OPTIONAL, when
they appear in this document, are to be interpreted as described in <xref target="RFC2119"/>.
</t>
<t>We also define the following terms for further use in this document:
</t>
<t>
<list style="symbols">
<t>STS Policy: A definition of the expected TLS availability and behavior, as
well as the desired actions for a given domain when a sending MTA encounters
different results.</t>
<t>Policy Domain: The domain against which an STS Policy is defined.</t>
</list>
</t>
</section>
</section>

<section anchor="related-technologies" title="Related Technologies">
<t>The DANE TLSA record <xref target="RFC7672"/> is similar, in that DANE is also designed to
upgrade opportunistic encryption into required encryption. DANE requires DNSSEC
<xref target="RFC4033"/> for the secure delivery of policies; the mechanism described here
presents a variant for systems not yet supporting DNSSEC, and specifies a method
for reporting TLS negotiation failures.
</t>

<section anchor="differences-from-dane" title="Differences from DANE">
<t>The primary difference between the mechanism described here and DANE is that DANE
requires the use of DNSSEC to authenticate DANE TLSA records, whereas SMTP STS
relies on the certificate authority (CA) system and a trust-on-first-use (TOFU)
approach to avoid interception. The TOFU model allows a degree of security
similar to that of HPKP <xref target="RFC7469"/>, reducing the complexity but without the
guarantees on first use offered by DNSSEC. (For a thorough discussion of this
trade-off, see the section <spanx style="emph">Security</spanx> <spanx style="emph">Considerations</spanx>.)
</t>
<t>In addition, SMTP STS introduces a mechanism for failure reporting and a
report-only mode, enabling progressive roll-out and auditing for compliance.
</t>
</section>

<section anchor="advantages-when-used-with-dane" title="Advantages When Used with DANE">
<t>SMTP STS can be deployed for a recipient domain that also publishes a DANE TLSA
record for SMTP. In these cases, the SMTP STS policy can additionally declare a
process for failure reporting.
</t>
</section>

<section anchor="advantages-when-used-without-dane" title="Advantages When Used Without DANE">
<t>When deployed without a DANE TLSA record, SMTP STS offers the following
advantages compared to DANE:
</t>
<t>
<list style="symbols">
<t><spanx style="emph">Infrastructure:</spanx> In comparison to DANE, this proposal does not require
 DNSSEC be deployed on either the sending or receiving domain. In addition,
 the reporting feature of SMTP STS can be deployed to perform offline
 analysis of STARTTLS failures, enabling mail providers to gain insight into
 the security of their SMTP connections without the need to modify MTA
 codebases directly.</t>
<t><spanx style="emph">Incrementalism:</spanx> DANE does not provide a reporting mechanism and does not
 have a concept of &quot;report-only&quot; for failures; as a result, a service provider
 has no choice but to &quot;flip the switch&quot; and affect the entire mail stream at
 once.</t>
</list>
</t>
</section>

<section anchor="disadvantages-when-used-without-dane" title="Disadvantages When Used Without DANE">
<t>When deployed alone (i.e. without a DANE record, and using Web PKI for
certificate verification), SMTP STS offers the following disadvantages compared
to DANE:
</t>
<t>
<list style="symbols">
<t>Infrastructure: DANE may be easier for some providers to deploy. In
particular, for providers who already support DNSSEC, SMTP STS would
additionally require they obtain a CA-signed x509 certificate for the
recipient domain.</t>
<t>Security: DANE offers an advantage against policy-lookup DoS attacks; that is,
while a DNSSEC-signed NX response to a DANE lookup authoritatively indicates
the lack of a DANE record, such an option to authenticate policy non-existence
does not exist when looking up a policy over plain DNS.</t>
</list>
</t>
</section>
</section>

<section anchor="policy-semantics" title="Policy Semantics">
<t>SMTP STS policies are distributed at the Policy Domain either through a new
resource record, or as TXT records (similar to DMARC policies) under the name
&quot;_smtp_sts.” (Current implementations deploy as TXT records.) For example, for
the Policy Domain &quot;example.com&quot;, the recipient's SMTP STS policy can be
retrieved from &quot;_smtp_sts.example.com.&quot;
</t>
<t>(Future implementations may move to alternate methods of policy discovery or
distribution. See the section <spanx style="emph">Future</spanx> <spanx style="emph">Work</spanx> for more discussion.)
</t>
<t>Policies MUST specify the following fields:
</t>
<t>
<list style="symbols">
<t>v: Version (plain-text, required). Currently only &quot;STS1&quot; is supported.</t>
<t>to:  TLS-Only (plain-text, required). If “true,” the receiving MTA requests
that messages be delivered only if they conform to the STS policy. If &quot;false,&quot;
the receiving MTA requests that failure reports be delivered, as specified by
the <spanx style="verb">rua</spanx> parameter.</t>
<t>mx: MX patterns (comma-separated list of plain-text MX match patterns,
required). One or more comma-separated patterns matching the expected MX for
this domain. For example, &quot;<spanx style="emph">.example.com,</spanx>.example.net&quot; indicates that mail
for this domain might be handled by any MX whose hostname is a subdomain of
&quot;example.com&quot; or &quot;example.net.&quot;</t>
<t>a: The mechanism to use to authenticate this policy itself. See the section
<spanx style="emph">Policy</spanx> <spanx style="emph">Authentication</spanx> for more details. Possible values are:
<list style="symbols">
<t>webpki:URI, where URI points to an HTTPS resource at the recipient domain
that serves the same policy text.</t>
<t>dnssec: Indicating that the policy is expected to be served over DNSSEC.</t>
</list></t>
<t>c: Constraints on the recipient MX's TLS certificate (plain-text, required).
See the section <spanx style="emph">Policy</spanx> <spanx style="emph">Validation</spanx> for more details. Possible values are:
<list style="symbols">
<t>webpki: Indicating that the TLS certificate presented by the recipient MX
will be validated according to the &quot;web PKI&quot; mechanism.</t>
<t>tlsa: Indicating that the TLS certificate presented by the recipient MX
will match a (presumed to exist) DANE TLSA record.</t>
</list></t>
<t>e: Max lifetime of the policy (plain-text integer seconds). Well-behaved
clients SHOULD cache a policy for up to this value from last policy fetch
time.</t>
<t>rua: Address to which aggregate feedback MAY be sent (comma-separated
plain-text list of email addresses, optional). For example,
&quot;mailto:postmaster@example.com&quot; from <xref target="RFC3986"/>.</t>
</list>
</t>

<section anchor="formal-definition" title="Formal Definition">
<t>The formal definition of the SMTP STS format, using <xref target="RFC5234"/>, is as follows:
</t>

<figure align="center"><artwork align="center">
sts-uri         = URI [ "!" 1*DIGIT [ "k" / "m" / "g" / "t" ] ]
                   ; "URI" is imported from [RFC3986]; commas (ASCII
                   ; 0x2C) and exclamation points (ASCII 0x21)
                   ; MUST be encoded; the numeric portion MUST fit
                   ; within an unsigned 64-bit integer

sts-record      = sts-version sts-sep sts-to
                   [sts-sep sts-mx]
                   [sts-sep sts-a]
                   [sts-sep sts-c]
                   [sts-sep sts-e]
                   [sts-sep sts-auri]
                   [sts-sep]
                   ; components other than sts-version and
                   ; sts-to may appear in any order

sts-version     = "v" *WSP "=" *WSP %x53 %x54 %x53 %x31

sts-sep         = *WSP %x3b *WSP

sts-to          = "to" *WSP "=" *WSP ( "true" / "false" )

sts-mx          = "mx" *WSP "=" *WSP sts-domain-list

sts-domain-list = (domain-match *("," domain-match))

domain-match    =  ["*."] 1*dtext *("." 1*dtext)

dtext           =  %d30-39 /          ; 0-9
                   %d41-5A /          ; a-z
                   %61-7A /           ; A-Z
                   %2D                ; "-"

sts-a           = "a" *WSP "=" *WSP ( URI / "dnssec")

sts-c           = "c" *WSP "=" *WSP ( "webpki" / "tlsa")

sts-e           = "e" *WSP "=" *WSP 1*6DIGIT

sts-auri        = "rua" *WSP "=" *WSP
                   sts-uri *(*WSP "," *WSP sts-uri)
</artwork></figure>
<t>A size limitation in a sts-uri, if provided, is interpreted as a
count of units followed by an OPTIONAL unit size (&quot;k&quot; for kilobytes,
&quot;m&quot; for megabytes, &quot;g&quot; for gigabytes, &quot;t&quot; for terabytes).  Without a
unit, the number is presumed to be a basic byte count.  Note that the
units are considered to be powers of two; a kilobyte is 2^10, a
megabyte is 2^20, etc.
</t>
</section>

<section anchor="policy-expirations" title="Policy Expirations">
<t>In order to resist attackers inserting a fraudulent policy, SMTP STS policies
are designed to be long-lived, with an expiry typically greater than two weeks.
Policy validity is controlled by two separate expiration times: the lifetime
indicated in the policy (&quot;e=&quot;) and the TTL on the DNS record itself. The policy
expiration will ordinarily be longer than that of the DNS TTL, and senders
SHOULD cache a policy (and apply it to all mail to the recipient domain) until
the policy expiration.
</t>
<t>An important consideration for domains publishing a policy is that senders will
see a policy expiration as relative to the fetch of a policy cached by their
recursive resolver. Consequently, a sender MAY treat a policy as valid for up to
{expiration time} + {DNS TTL}. Publishers SHOULD thus continue to expect senders
to apply old policies for up to this duration.
</t>
</section>

<section anchor="policy-authentication" title="Policy Authentication">
<t>The security of a domain implementing an SMTP STS policy against an active
man-in-the-middle depends primarily upon the long-lived caching of policies.
However, to allow recipient domains to safely serve new policies <spanx style="emph">prior</spanx> to the
expiration of a cached policy, and to prevent long-term (either malicious or
active) denials of service, it is important that senders are able to validate a
new policy retrieved for a recipient domain. There are two supported mechanisms
for policy validation:
</t>
<t>
<list style="symbols">
<t>Web PKI: In this mechanism, indicated by the &quot;webpki&quot; value of the &quot;a&quot; field,
the sender fetches a HTTPS resource from the URI indicated. For example,
a=webpki:<eref target="https://example.com/.well-known/smtp-sts/current"/> indicates that the
sender should fetch the resource
<eref target="https://example.com/.well-known/smtp-sts/current"/>. In order for the policy to
be valid, the HTTP response body served at this resource MUST exactly match
the policy initially loaded via the DNS TXT method, and MUST be served from an
HTTPS endpoint at the domain matching that of the recipient domain.  (As this
RFC progress, the authors intend to register .well-known/smtp-sts.  See
<xref target="RFC5785"/>. See <spanx style="emph">Future</spanx> <spanx style="emph">Work</spanx> for more information.)</t>
<t>DNSSEC: In this mechanism, indicated by the &quot;dnssec&quot; value of the &quot;a&quot; field,
the sender MUST retrieve the policy via a DNSSEC signed response for the
_smtp_sts TXT record.</t>
</list>
</t>
<t>When fetching a new policy when one is not already known, or when fetching a
policy for a domain with an expired policy, unauthenticated policies MUST be
trusted and honored. When fetching a policy and authenticating it, as described
in detail in <spanx style="emph">Policy</spanx> <spanx style="emph">Application</spanx>, policies will be authenticated using the
mechanism specified by the existing cached policy.
</t>
<t>Note, however, as described in detail in <spanx style="emph">Policy</spanx> <spanx style="emph">Application</spanx>, that new
policies MUST NOT be considered as valid if they do not validate on first
application. That is, a freshly fetched (and unused) policy that has not
successfully been applied MUST be disregarded.
</t>
</section>

<section anchor="policy-validation" title="Policy Validation">
<t>When sending to an MX at a domain for which the sender has a valid and
non-expired SMTP STS policy, a sending MTA honoring SMTP STS SHOULD validate
that the recipient MX supports STARTTLS and offers a TLS certificate which is
valid according to the semantics of the SMTP STS policy. Policies can specify
certificate validity in one of two ways by setting the value of the &quot;c&quot; field in
the policy description.
</t>
<t>
<list style="symbols">
<t>Web PKI: When the &quot;c&quot; field is set to &quot;webpki&quot;, the certificate presented by
the receiving MX MUST be valid for the MX name and chain to a root CA that is
trusted by the sending MTA. The certificate MUST have a CN or SAN matching the
MX hostname (as described in <xref target="RFC6125"/>) and be non-expired.</t>
<t>DANE TLSA: When the &quot;c&quot; field is set to &quot;tlsa&quot;, the receiving MX MUST be
covered by a DANE TLSA record for the recipient domain, and the presented
certificate MUST be valid according to that record (as described by
<xref target="RFC7672"/>).</t>
</list>
</t>
<t>A sending MTA who does not support the validation method required--for example,
an MTA that does not have a DNSSEC-compatible resolver--MUST behave as though
the policy did not validate. As described in the section on <spanx style="emph">Policy</spanx>
<spanx style="emph">Application</spanx>, a policy which has not ever been successfully validated MUST not
be used to reject mail.
</t>
</section>

<section anchor="policy-application" title="Policy Application">
<t>When sending to an MX at a domain for which the sender has a valid non-expired
SMTP STS policy, a sending MTA honoring SMTP STS MAY apply the result of a
policy validation one of two ways:
</t>
<t>
<list style="symbols">
<t>Report-only: In this mode, sending MTAs merely send a report to the designated
report address indicating policy application failures. This can be done
&quot;offline&quot;, i.e. based on the MTA logs, and is thus a suitable low-risk option
for MTAs who wish to enhance transparency of TLS tampering without making
complicated changes to production mail-handling infrastructure.</t>
<t>Enforced: In this mode, sending MTAs SHOULD treat STS policy failures, in
which the policy action is &quot;reject&quot;, as a mail delivery error, and SHOULD
terminate the SMTP connection, not delivering any more mail to the recipient
MTA.</t>
</list>
</t>
<t>In enforced mode, however, sending MTAs MUST first check for a new
<spanx style="emph">authenticated</spanx> policy before actually treating a message failure as fatal.
</t>
<t>Thus the control flow for a sending MTA that does online policy application
consists of the following steps:
</t>
<t>
<list style="numbers">
<t>Check for cached non-expired policy. If none exists, fetch the latest and
cache it.</t>
<t>Validate recipient MTA against policy. If valid, deliver mail.</t>
<t>If policy invalid and policy specifies reporting, generate report.</t>
<t>If policy invalid and policy specifies rejection, perform the following
steps:
<list style="symbols">
<t>Check for a new (non-cached) <spanx style="emph">authenticated</spanx> policy. If one exists, update
the current policy and go to step 1.</t>
<t>If none exists or the newly fetched policy also fails, treat the delivery
as a failure.</t>
</list></t>
</list>
</t>
<t>Understanding the details of step 4 is critical to understanding the behavior of
the system as a whole.
</t>
<t>Remember that each policy has an expiration time (which SHOULD be long, on the
order of days or months) and a validation method. With these two mechanisms and
the procedure specified in step 4, recipients who publish a policy have, in
effect, a means of updating a cached policy at arbitrary intervals, without the
risks (of a man-in-the-middle attack) they would incur if they were to shorten
the policy expiration time.
</t>
</section>
</section>

<section anchor="failure-reporting" title="Failure Reporting">
<t>Aggregate statistics on policy failures MAY be reported to the URI indicated
in the &quot;rua&quot; field of the policy. SMTP STS reports contain information about
policy failures to allow diagnosis of misconfigurations and malicious activity.
</t>
<t>(There may also be a need for enabling more detailed &quot;forensic&quot; reporting during
initial stages of a deployment. To address this, the authors consider the
possibility of an optional additional &quot;forensic reporting mode&quot; in which more
details--such as certificate chains and MTA banners--may be reported. See the
section <spanx style="emph">Future</spanx> <spanx style="emph">Work</spanx> for more details.)
</t>
<t>Aggregate reports contain the following fields:
</t>
<t>
<list style="symbols">
<t>The SMTP STS policy applied (as a string)</t>
<t>The beginning and end of the reporting period</t>
</list>
</t>
<t>Repeated records contain the following fields:
</t>
<t>
<list style="symbols">
<t>Failure type: This list will start with the minimal set below, and is expected
to grow over time based on real-world experience. The initial set is:
<list style="symbols">
<t>mx-mismatch: This indicates that the MX resolved for the recipient domain did
not match the MX constraint specified in the policy.</t>
<t>certificate-mismatch: This indicates that the certificate presented by the
receiving MX did not match the MX hostname</t>
<t>invalid-certificate: This indicates that the certificate presented by the
receiving MX did not validate according to the policy validation constraint.
(Either it was not signed by a trusted CA or did not match the DANE TLSA
record for the recipient MX.)</t>
<t>expired-certificate: This indicates that the certificate has expired.</t>
<t>starttls-not-supported: This indicates that the recipient MX did not support
STARTTLS.</t>
<t>tlsa-invalid: This indicates a validation error for Policy Domain specifying
&quot;tlsa&quot; validation.</t>
<t>dnssec-invalid: This indicates a failure to validate DNS records for a
Policy Domain specifying &quot;tlsa&quot; validation or &quot;dnssec&quot; authentication.</t>
<t>sender-does-not-support-validation-method: This indicates the sending system
can never validate using the requested validation mechanism.</t>
</list></t>
<t>Count: The number of times the error was encountered.</t>
<t>Hostname: The hostname of the recipient MX.</t>
</list>
</t>
<t>Note that the failure types are non-exclusive; an aggregate report MAY contain
overlapping counts of failure types where a single send attempt encountered
multiple errors.
</t>
<t>When sending failure reports, sending MTAs MUST NOT honor SMTP STS or DANE
TLSA failures.
</t>
</section>

<section anchor="iana-considerations" title="IANA Considerations">
<t>The <spanx style="verb">.well-known</spanx> URI for Policy Domains to host their STS Policies will be
registered by following the procedure documented in <xref target="RFC5785"/> (i.e. sending a
request to the <spanx style="verb">wellknown-uri-review@ietf.org</spanx> mailing list for review and comment).
The proposed URI-suffix is <spanx style="verb">smtp-sts</spanx>.
</t>
</section>

<section anchor="security-considerations" title="Security Considerations">
<t>SMTP Strict Transport Security protects against an active attacker who wishes to
intercept or tamper with mail between hosts who support STARTTLS. There are two
classes of attacks considered:
</t>
<t>
<list style="symbols">
<t>Foiling TLS negotiation, for example by deleting the &quot;250 STARTTLS&quot; response
from a server or altering TLS session negotiation. This would result in the
SMTP session occurring over plaintext, despite both parties supporting TLS.</t>
<t>Impersonating the destination mail server, whereby the sender might deliver
the message to an impostor, who could then monitor and/or modify messages
despite opportunistic TLS. This impersonation could be accomplished by
spoofing the DNS MX record for the recipient domain, or by redirecting client
connections to the legitimate recipient server (for example, by altering BGP
routing tables).</t>
</list>
</t>
<t>SMTP Strict Transport Security relies on certificate validation via either TLS
identity checking <xref target="RFC6125"/> or DANE TLSA <xref target="RFC7672"/>. Attackers who are able
to obtain a valid certificate for the targeted recipient mail service (e.g. by
compromising a certificate authority) are thus out of scope of this threat
model.
</t>
<t>In the WebPKI constraint mode, an attacker who is able to block DNS responses can
suppress the delivery of an STS Policy, making the Policy Domain appear not to have
an STS Policy. The caching model described in <spanx style="emph">Policy</spanx> <spanx style="emph">Expirations</spanx> is designed to
resist this attack, and there is discussion in the <spanx style="emph">Future</spanx> <spanx style="emph">Work</spanx> section around
future distribution mechanisms that are robust against this attack.
</t>
</section>

<section anchor="future-work" title="Future Work">
<t>The authors would like to suggest multiple considerations for future discussion.
</t>
<t>
<list style="symbols">
<t>Certificate pinning: One potential improvement in the robustness of the
certificate validation methods discussed would be the deployment of public-key
pinning as defined for HTTP in <xref target="RFC7469"/>. A policy extension supporting
these semantics would enable Policy Domains to specify certificates that MUST
appear in the MX certificate chain, thus providing resistence against
compromised CA or DNSSEC zone keys.</t>
<t>Policy distribution: As with Certificate Transparency (<xref target="RFC6962"/>), it may be
possible to provide a verifiable log of policy <spanx style="emph">observations</spanx> (meaning which
policies have been observed for a given Policy Domain). This would provide
insight into policy spoofing or faked policy non-existence. This may be
particularly useful for Policy Domains not using DNSSEC, since it would
provide sending MTAs an authoritative source for whether a policy is expected
for a given domain.</t>
<t>Receive-from restrictions: Policy publishers may wish to also indicate to
domains <spanx style="emph">receiving</spanx> mail from the Policy Domain that all such mail is expected
to be sent via TLS. This may allow policy publishers to receive reports
indicating sending MTA misconfigurations. However, the security properties of
a &quot;receiver-enforced&quot; system differ from those of the current design; in
particular, an active man-in-the-middle attacker may be able to exploit
misconfigured sending MTAs in a way that would not be possible today with a
sender-enforced model.</t>
<t>Cipher and TLS version restrictions: Policy publishers may also wish to
restrict TLS negotiation to specific ciphers or TLS versions.</t>
</list>
</t>
<t>In addition, the authors leave currently open the following details:
</t>
<t>
<list style="symbols">
<t>Whether and how more detailed &quot;forensic reporting&quot; should be accomplished, as
discussed in the section <spanx style="emph">Failure</spanx> <spanx style="emph">Reporting</spanx>.</t>
<t>The registration of the .well-known/smtp-sts URI as per <xref target="RFC5785"/>.</t>
</list>
</t>
</section>

<section anchor="appendix-1-validation-pseudocode" title="Appendix 1: Validation Pseudocode">

<figure align="center"><artwork align="center">
policy = policy_from_cache()
if not policy or is_expired(policy):
  policy = policy_from_dns()  // fetch and authenticate!
  update_cache = true
if policy:
  if invalid_mx_or_tls(policy):  // check MX and TLS cert
    if rua:
      generate_report()
    if p_reject():
      policy = policy_from_dns()  // fetch and authenticate #2!
      update_cache = true
      if invalid_mx_or_tls(policy):
        reject_message()
        update_cache = false
  if update_cache:
    cache(policy)
</artwork></figure>
</section>

<section anchor="appendix-2-domain-owner-sts-example-record" title="Appendix 2: Domain Owner STS example record">

<figure align="center"><artwork align="center">

The owner wishes to begin using STS
with a policy that will solicit aggregate feedback from receivers
without affecting how the messages are processed, in order to:

* Confirm that its legitimate messages are sent over TLS

* Verify the validity of the certificates

* Verify what cyphers are in use

* Determine how many messages would be affected by a strict policy

_smtp_sts  IN TXT ( "v=STS1; to=false; "
                     "rua=mailto:sts-feedback@example.com " )
</artwork></figure>
</section>

<section anchor="appendix-3-xml-schema-for-failure-reports" title="Appendix 3: XML Schema for Failure Reports">

<figure align="center"><artwork align="center">
&lt;?xml version="1.0"?&gt;
&lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    targetNamespace="http://www.example.org/smtp-sts-xml/0.1"
    xmlns:tns="http://www.example.org/smtp-sts-xml/0.1"&gt;
   &lt;!-- The time range in UTC covered by messages in this report,
        specified in seconds since epoch. --&gt;
   &lt;xs:complexType name="DateRangeType"&gt;
     &lt;xs:all&gt;
       &lt;xs:element name="begin" type="xs:integer"/&gt;
       &lt;xs:element name="end" type="xs:integer"/&gt;
     &lt;/xs:all&gt;
   &lt;/xs:complexType&gt;

   &lt;!-- Report generator metadata. --&gt;
   &lt;xs:complexType name="ReportMetadataType"&gt;
     &lt;xs:sequence&gt;
       &lt;xs:element name="org_name" type="xs:string"/&gt;
       &lt;xs:element name="email" type="xs:string"/&gt;
       &lt;xs:element name="extra_contact_info" type="xs:string"
                   minOccurs="0"/&gt;
       &lt;xs:element name="report_id" type="xs:string"/&gt;
       &lt;xs:element name="date_range" type="tns:DateRangeType"/&gt;
     &lt;/xs:sequence&gt;
   &lt;/xs:complexType&gt;


   &lt;!-- The constraints applied in a policy --&gt;
   &lt;xs:simpleType name="ConstraintType"&gt;
     &lt;xs:restriction base="xs:string"&gt;
       &lt;xs:enumeration value="WebPKI"/&gt;
       &lt;xs:enumeration value="TLSA"/&gt;
     &lt;/xs:restriction&gt;
   &lt;/xs:simpleType&gt;

   &lt;!-- The policy that was applied at send time. --&gt;
   &lt;xs:complexType name="AppliedPolicyType"&gt;
     &lt;xs:all&gt;
       &lt;xs:element name="domain" type="xs:string"/&gt;
       &lt;xs:element name="mx" type="xs:string"
           minOccurs="1" /&gt;
       &lt;xs:element name="constraint" type="tns:ConstraintType"/&gt;
     &lt;/xs:all&gt;
   &lt;/xs:complexType&gt;

   &lt;!-- The possible failure types applied in a policy --&gt;
   &lt;xs:simpleType name="FailureType"&gt;
     &lt;xs:restriction base="xs:string"&gt;
       &lt;xs:enumeration value="MxMismatch"/&gt;
       &lt;xs:enumeration value="InvalidCertificate"/&gt;
       &lt;xs:enumeration value="ExpiredCertificate"/&gt;
       &lt;xs:enumeration value="StarttlsNotSupported"/&gt;
       &lt;xs:enumeration value="TlsaInvalid"/&gt;
       &lt;xs:enumeration value="DnssecInvalid"/&gt;
       &lt;xs:enumeration value="SenderDoesNotSupportValidationMethod"/&gt;
     &lt;/xs:restriction&gt;
   &lt;/xs:simpleType&gt;

   &lt;!-- The possible enforcement level: whether the reporter also drops
        messages --&gt;
   &lt;xs:simpleType name="EnforcementLevelType"&gt;
     &lt;xs:restriction base="xs:string"&gt;
       &lt;xs:enumeration value="ReportOnly"/&gt;
       &lt;xs:enumeration value="Reject"/&gt;
     &lt;/xs:restriction&gt;
   &lt;/xs:simpleType&gt;

   &lt;!-- Record for individual failure types. --&gt;
   &lt;xs:complexType name="FailureRecordType"&gt;
     &lt;xs:all&gt;
       &lt;xs:element name="failure" type="tns:FailureType"/&gt;
       &lt;xs:element name="count" type="xs:integer"/&gt;
       &lt;xs:element name="hostname" type="xs:string"/&gt;
       &lt;xs:element name="connectedIp" type="xs:string" minOccurs="0"/&gt;
       &lt;xs:element name="sourceIp" type="xs:string" minOccurs="0"/&gt;
     &lt;/xs:all&gt;
   &lt;/xs:complexType&gt;

    &lt;!-- Parent --&gt;
   &lt;xs:element name="feedback"&gt;
     &lt;xs:complexType&gt;
       &lt;xs:sequence&gt;
         &lt;xs:element name="version"
                     type="xs:decimal"/&gt;
         &lt;xs:element name="report_metadata"
                     type="tns:ReportMetadataType"/&gt;
         &lt;xs:element name="applied_policy"
                     type="tns:AppliedPolicyType"/&gt;
   &lt;xs:element name="enforcement_level"
   type="tns:EnforcementLevelType"/&gt;
         &lt;xs:element name="record" type="tns:FailureRecordType"
                     maxOccurs="unbounded"/&gt;
       &lt;/xs:sequence&gt;
     &lt;/xs:complexType&gt;
   &lt;/xs:element&gt;
&lt;/xs:schema&gt;
</artwork></figure>
</section>

<section anchor="appendix-4-example-report" title="Appendix 4: Example report">

<figure align="center"><artwork align="center">
&lt;feedback xmlns="http://www.example.org/smtp-sts-xml/0.1"&gt;
  &lt;version&gt;1&lt;/version&gt;
  &lt;report_metadata&gt;
    &lt;org_name&gt;Company XYZ&lt;/org_name&gt;
    &lt;email&gt;sts-reporting@company.com&lt;/email&gt;
    &lt;extra_contact_info&gt;&lt;/extra_contact_info&gt;
    &lt;report_id&gt;12345&lt;/report_id&gt;
    &lt;date_range&gt;&lt;begin&gt;1439227624&lt;/begin&gt;
    &lt;end&gt;1439313998&lt;/end&gt;&lt;/date_range&gt;
    &lt;/report_metadata&gt;
  &lt;applied_policy&gt;
    &lt;domain&gt;company.com&lt;/domain&gt;
    &lt;mx&gt;*.mx.mail.company.com&lt;/mx&gt;
    &lt;constraint&gt;WebPKI&lt;/constraint&gt;
  &lt;/applied_policy&gt;
   &lt;enforcement_level&gt;ReportOnly&lt;/enforcement_level&gt;
  &lt;record&gt;
      &lt;failure&gt;ExpiredCertificate&lt;/failure&gt;
      &lt;count&gt;13128&lt;/count&gt;
      &lt;hostname&gt;mta7.am0.yahoodns.net.&lt;/hostname&gt;
      &lt;connectedIp&gt; 98.136.216.25&lt;/connectedIp&gt;
  &lt;/record&gt;
  &lt;record&gt;
      &lt;failure&gt;StarttlsNotSupported&lt;/failure&gt;
      &lt;count&gt;19&lt;/count&gt;
      &lt;hostname&gt;mta7.am0.yahoodns.net.&lt;/hostname&gt;
      &lt;connectedIp&gt;98.22.33.99&lt;/connectedIp&gt;
  &lt;/record&gt;
&lt;/feedback&gt;
</artwork></figure>
</section>

</middle>
<back>
<references title="Normative References">
<?rfc include="http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"?>
<?rfc include="http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3207.xml"?>
<?rfc include="http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3986.xml"?>
<?rfc include="http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4033.xml"?>
<?rfc include="http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5234.xml"?>
<?rfc include="http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5785.xml"?>
<?rfc include="http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6125.xml"?>
<?rfc include="http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6962.xml"?>
<?rfc include="http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7469.xml"?>
<?rfc include="http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7672.xml"?>
</references>

</back>
</rfc>
