<?xml version="1.0" encoding="UTF-8"?>
  <?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
  <!-- generated by https://github.com/cabo/kramdown-rfc2629 version 1.0.30 -->

<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
]>

<?rfc toc="yes"?>
<?rfc sortrefs="yes"?>
<?rfc symrefs="yes"?>

<rfc ipr="trust200902" docName="draft-ietf-httpbis-expect-ct-00" category="exp">

  <feedback xmlns='http://purl.org/net/xml2rfc/ext' template="mailto:ietf-http-wg@w3.org?subject={docname},%20%22{section}%22&amp;body=%3c{ref}%3e:"/><front>
    <title abbrev="Expect-CT">Expect-CT Extension for HTTP</title>

    <author initials="E." surname="Stark" fullname="Emily Stark">
      <organization>Google</organization>
      <address>
        <email>estark@google.com</email>
      </address>
    </author>

    <date year="2017" month="2" day="8"/>

    <area>Applications and Real-Time</area>
    <workgroup>HTTP</workgroup>
    

    <abstract>


<t>This document defines a new HTTP header, named Expect-CT, that allows web host
operators to instruct user agents to expect valid Signed Certificate Timestamps
(SCTs) to be served on connections to these hosts. When configured in
enforcement mode, user agents (UAs) will remember that hosts expect SCTs and
will refuse connections that do not conform to the UA’s Certificate Transparency
policy. When configured in report-only mode, UAs will report the lack of valid
SCTs to a URI configured by the host, but will allow the connection. By turning
on Expect-CT, web host operators can discover misconfigurations in their
Certificate Transparency deployments and ensure that misissued certificates
accepted by UAs are discoverable in Certificate Transparency logs.</t>



    </abstract>


    <note title="Note to Readers">


<t>Discussion of this draft takes place on the HTTP working group mailing list
(ietf-http-wg@w3.org), which is archived at <eref target="https://lists.w3.org/Archives/Public/ietf-http-wg/">https://lists.w3.org/Archives/Public/ietf-http-wg/</eref>.</t>

<t>Working Group information can be found at <eref target="http://httpwg.github.io/">http://httpwg.github.io/</eref>; source
code and issues list for this draft can be found at
<eref target="https://github.com/httpwg/http-extensions/labels/expect-ct">https://github.com/httpwg/http-extensions/labels/expect-ct</eref>.</t>


    </note>


  </front>

  <middle>


<section anchor="introduction" title="Introduction">

<t>This document defines a new HTTP header that enables UAs to identify web hosts
that expect the presence of Signed Certificate Timestamps (SCTs) <xref target="RFC6962"/> in
future Transport Layer Security (TLS) <xref target="RFC5246"/> connections.</t>

<t>Web hosts that serve the Expect-CT HTTP header are noted by the UA as Known
Expect-CT Hosts. The UA evaluates each connection to a Known Expect-CT Host for
compliance with the UA’s Certificate Transparency (CT) Policy. If the connection
violates the CT Policy, the UA sends a report to a URI configured by the
Expect-CT Host and/or fails the connection, depending on the configuration that
the Expect-CT Host has chosen.</t>

<t>If misconfigured, Expect-CT can cause unwanted connection failures (for example,
if a host deploys Expect-CT but then switches to a legitimate certificate that
is not logged in Certificate Transparency logs, or if a web host operator
believes their certificate to conform to all UAs’ CT policies but is
mistaken). Web host operators are advised to deploy Expect-CT with caution, by
using the reporting feature and gradually increasing the interval where the UA
remembers the host as a Known Expect-CT Host. These precautions can help web
host operators gain confidence that their Expect-CT deployment is not causing
unwanted connection failures.</t>

<t>Expect-CT is a trust-on-first-use (TOFU) mechanism. The first time a UA
connects to a host, it lacks the information necessary to require SCTs for the
connection. Thus, the UA will not be able to detect and thwart an attack on the
UA’s first connection to the host. Still, Expect-CT provides value by 1)
allowing UAs to detect the use of unlogged certificates after the initial
communication, and 2) allowing web hosts to be confident that UAs are only
trusting publicly-auditable certificates.</t>

<section anchor="requirements-language" title="Requirements Language">

<t>The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”,
“SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and “OPTIONAL” in this
document are to be interpreted as described in RFC 2119 <xref target="RFC2119"/>.</t>

</section>
<section anchor="terminology" title="Terminology">

<t>Terminology is defined in this section.</t>

<t><list style="hanging">
  <t hangText='Certificate Transparency Policy'>
  is a policy defined by the UA concerning the number, sources, and delivery
  mechanisms of Signed Certificate Timestamps that are served on TLS
  connections. The policy defines the properties of a connection that must be
  met in order for the UA to consider it CT-qualified.</t>
  <t hangText='Certificate Transparency Qualified'>
  describes a TLS connection for which the UA has determined that a sufficient
  quantity and quality of Signed Certificate Timestamps have been provided.</t>
  <t hangText='CT-qualified'>
  See Certificate Transparency Qualified.</t>
  <t hangText='CT Policy'>
  See Certificate Transparency Policy.</t>
  <t hangText='Expect-CT Host'>
  See HTTP Expect-CT Host.</t>
  <t hangText='HTTP Expect-CT'>
  is the overall name for the combined UA- and server-side security policy
  defined by this specification.</t>
  <t hangText='HTTP Expect-CT Host'>
  is a conformant host implementing the HTTP server aspects of HTTP
  Expect-CT. This means that an Expect-CT Host returns the “Expect-CT” HTTP
  response header field in its HTTP response messages sent over secure
  transport.</t>
  <t hangText='Known Expect-CT Host'>
  is an Expect-CT Host that the UA has noted as such. See
  <xref target="noting-expect-ct"/> for particulars.</t>
  <t hangText='UA'>
  is an acronym for “user agent”. For the purposes of this specification, a UA
  is an HTTP client application typically actively manipulated by a user
  <xref target="RFC2616"/>.</t>
  <t hangText='Unknown Expect-CT Host'>
  is an Expect-CT Host that the UA has not noted.</t>
</list></t>

</section>
</section>
<section anchor="server-and-client-behavior" title="Server and Client Behavior">

<section anchor="response-header-field-syntax" title="Response Header Field Syntax">

<t>The “Expect-CT” header field is a new response header defined in this
specification. It is used by a server to indicate that UAs should evaluate
connections to the host emitting the header for CT compliance
(<xref target="expect-ct-compliance"/>).</t>

<t><xref target="expect-ct-syntax"/> describes the syntax (Augmented Backus-Naur Form) of the header field,
using the grammar defined in RFC 5234 <xref target="RFC5234"/> and the rules defined in
Section 3.2 of RFC 7230 <xref target="RFC7230"/>.</t>

<figure title="Syntax of the Expect-CT header field" anchor="expect-ct-syntax"><artwork type="abnf"><![CDATA[
Expect-CT-Directives = directive *( OWS ";" OWS directive )
directive            = directive-name [ "=" directive-value ]
directive-name       = token
directive-value      = token / quoted-string
]]></artwork></figure>

<t>Optional white space (<spanx style="verb">OWS</spanx>) is used as defined in Section 3.2.3 of RFC 7230
<xref target="RFC7230"/>. <spanx style="verb">token</spanx> and <spanx style="verb">quoted-string</spanx> are used as defined in Section 3.2.6
of RFC 7230 <xref target="RFC7230"/>.</t>

<t>The directives defined in this specification are described below. The overall
requirements for directives are:</t>

<t><list style="numbers">
  <t>The order of appearance of directives is not significant.</t>
  <t>A given directive MUST NOT appear more than once in a given header
field. Directives are either optional or required, as stipulated in their
definitions.</t>
  <t>Directive names are case insensitive.</t>
  <t>UAs MUST ignore any header fields containing directives, or other header
field value data, that do not conform to the syntax defined in this
specification.  In particular, UAs must not attempt to fix malformed header
fields.</t>
  <t>If a header field contains any directive(s) the UA does not recognize, the
UA MUST ignore those directives.</t>
  <t>If the Expect-CT header field otherwise satisfies the above requirements (1
through 5), the UA MUST process the directives it recognizes.</t>
</list></t>

<section anchor="the-report-uri-directive" title="The report-uri Directive">

<t>The OPTIONAL <spanx style="verb">report-uri</spanx> directive indicates the URI to which the UA SHOULD
report Expect-CT failures (<xref target="expect-ct-compliance"/>). The UA POSTs the reports
to the given URI as described in <xref target="reporting-expect-ct-failure"/>.</t>

<t>The <spanx style="verb">report-uri</spanx> directive is REQUIRED to have a directive value, for which the
syntax is defined in <xref target="reporturi-syntax"/>.</t>

<figure title="Syntax of the report-uri directive value" anchor="reporturi-syntax"><artwork type="abnf"><![CDATA[
report-uri-value = absolute-URI
]]></artwork></figure>

<t><spanx style="verb">absolute-URI</spanx> is defined in Section 4.3 of RFC 3986 <xref target="RFC3986"/>.</t>

<t>Hosts may set <spanx style="verb">report-uri</spanx>s that use HTTP or HTTPS. If the scheme in the
<spanx style="verb">report-uri</spanx> is one that uses TLS (e.g., HTTPS), UAs MUST check Expect-CT
compliance when the host in the <spanx style="verb">report-uri</spanx> is a Known Expect-CT Host;
similarly, UAs MUST apply HSTS if the host in the <spanx style="verb">report-uri</spanx> is a Known HSTS
Host.</t>

<t>Note that the report-uri need not necessarily be in the same Internet
domain or web origin as the host being reported about.</t>

<t>UAs SHOULD make their best effort to report Expect-CT failures to the
<spanx style="verb">report-uri</spanx>, but they may fail to report in exceptional conditions.  For
example, if connecting the <spanx style="verb">report-uri</spanx> itself incurs an Expect-CT failure or
other certificate validation failure, the UA MUST cancel the connection.
Similarly, if Expect-CT Host A sets a <spanx style="verb">report-uri</spanx> referring to Expect-CT Host
B, and if B sets a <spanx style="verb">report-uri</spanx> referring to A, and if both hosts fail to comply
to the UA’s CT Policy, the UA SHOULD detect and break the loop by failing to
send reports to and about those hosts.</t>

<t>UAs SHOULD limit the rate at which they send reports. For example, it is
unnecessary to send the same report to the same <spanx style="verb">report-uri</spanx> more than once.</t>

</section>
<section anchor="the-enforce-directive" title="The enforce Directive">

<t>The OPTIONAL <spanx style="verb">enforce</spanx> directive is a valueless directive that, if present
(i.e., it is “asserted”), signals to the UA that compliance to the CT Policy
should be enforced (rather than report-only) and that the UA should refuse
future connections that violate its CT Policy. When both the <spanx style="verb">enforce</spanx> directive
and <spanx style="verb">report-uri</spanx> directive (as defined in <xref target="reporturi-syntax"/>) are present, the
configuration is referred to as an “enforce-and-report” configuration,
signalling to the UA both that compliance to the CT Policy should be enforced
and that violations should be reported.</t>

</section>
<section anchor="the-max-age-directive" title="The max-age Directive">

<t>The <spanx style="verb">max-age</spanx> directive specifies the number of seconds after the reception of
the Expect-CT header field during which the UA SHOULD regard the host from whom
the message was received as a Known Expect-CT Host.</t>

<t>The <spanx style="verb">max-age</spanx> directive is REQUIRED to be present within an “Expect-CT” header
field. The <spanx style="verb">max-age</spanx> directive is REQUIRED to have a directive value, for which
the syntax (after quoted-string unescaping, if necessary) is defined in
<xref target="maxage-syntax"/>.</t>

<figure title="Syntax of the max-age directive value" anchor="maxage-syntax"><artwork type="abnf"><![CDATA[
max-age-value = delta-seconds
delta-seconds = 1*DIGIT
]]></artwork></figure>

<t><spanx style="verb">delta-seconds</spanx> is used as defined in Section 1.2.1 of RFC 7234 <xref target="RFC7234"/>.</t>

</section>
</section>
<section anchor="server-processing-model" title="Server Processing Model">

<t>This section describes the processing model that Expect-CT Hosts implement.  The
model has 2 parts: (1) the processing rules for HTTP request messages received
over a secure transport (e.g., authenticated, non-anonymous TLS); and (2) the
processing rules for HTTP request messages received over non-secure transports,
such as TCP.</t>

<section anchor="http-over-secure-transport-request-type" title="HTTP-over-Secure-Transport Request Type">

<t>When replying to an HTTP request that was conveyed over a secure transport, an
Expect-CT Host SHOULD include in its response exactly one Expect-CT header
field. The header field MUST satisfy the grammar specified in
<xref target="response-header-field-syntax"/>.</t>

<t>Establishing a given host as an Expect-CT Host, in the context of a given UA,
is accomplished as follows:</t>

<t><list style="numbers">
  <t>Over the HTTP protocol running over secure transport, by correctly returning
(per this specification) at least one valid Expect-CT header field to the
UA.</t>
  <t>Through other mechanisms, such as a client-side preloaded Expect-CT Host
list.</t>
</list></t>

</section>
<section anchor="http-request-type" title="HTTP Request Type">

<t>Expect-CT Hosts SHOULD NOT include the Expect-CT header field in HTTP responses
conveyed over non-secure transport.  UAs MUST ignore any Expect-CT header
received in an HTTP response conveyed over non-secure transport.</t>

</section>
</section>
<section anchor="user-agent-processing-model" title="User Agent Processing Model">

<t>The UA processing model relies on parsing domain names.  Note that
internationalized domain names SHALL be canonicalized according to
the scheme in Section 10 of <xref target="RFC6797"/>.</t>

<section anchor="expect-ct-header-field-processing" title="Expect-CT Header Field Processing">

<t>If the UA receives, over a secure transport, an HTTP response that includes an
Expect-CT header field conforming to the grammar specified in
<xref target="response-header-field-syntax"/>, the UA MUST evaluate the connection on which
the header was received for compliance with the UA’s CT Policy, and then process
the Expect-CT header field as follows.</t>

<t>If the connection complies with the UA’s CT Policy (i.e. the connection is
CT-qualified), then the UA MUST either:</t>

<t><list style="symbols">
  <t>Note the host as a Known Expect-CT Host if it is not already so noted (see
<xref target="noting-expect-ct"/>), or</t>
  <t>Update the UA’s cached information for the Known Expect-CT Host if the
<spanx style="verb">enforce</spanx>, <spanx style="verb">max-age</spanx>, or <spanx style="verb">report-uri</spanx> header field value directives convey
information different from that already maintained by the UA. If the <spanx style="verb">max-age</spanx>
directive has a value of 0, the UA MUST remove its cached Expect-CT
information if the host was previously noted as a Known Expect-CT Host, and
MUST NOT note this host as a Known Expect-CT Host if it is not already noted.</t>
</list></t>

<t>If the connection does not comply with the UA’s CT Policy (i.e. is not
CT-qualified), then the UA MUST NOT note this host as a Known Expect-CT Host.</t>

<t>If the header field includes a <spanx style="verb">report-uri</spanx> directive, and the connection does
not comply with the UA’s CT Policy (i.e. the connection is not CT-qualified),
and the UA has not already sent an Expect-CT report for this connection, then
the UA SHOULD send a report to the specified <spanx style="verb">report-uri</spanx> as specified in
<xref target="reporting-expect-ct-failure"/>.</t>

<t>If a UA receives more than one Expect-CT header field in an HTTP response
message over secure transport, then the UA MUST process only the first Expect-CT
header field.</t>

<t>The UA MUST ignore any Expect-CT header field not conforming to the grammar
specified in <xref target="response-header-field-syntax"/>.</t>

</section>
<section anchor="noting-an-expect-ct-host-storage-model" title="Noting an Expect-CT Host - Storage Model">

<t>The “effective Expect-CT date” of a Known Expect-CT Host is the time that the UA
observed a valid Expect-CT header for the host. The “effective expiration date”
of a Known Expect-CT Host is the effective Expect-CT date plus the max-age. An
Expect-CT Host is “expired” if the effective expiration date refers to a date in
the past. The UA MUST ignore any expired Expect-CT Hosts in its cache.</t>

<t>Known Expect-CT Hosts are identified only by domain names, and never IP
addresses. If the substring matching the host production from the Request-URI
(of the message to which the host responded) syntactically matches the
IP-literal or IPv4address productions from Section 3.2.2 of <xref target="RFC3986"/>, then
the UA MUST NOT note this host as a Known Expect-CT Host.</t>

<t>Otherwise, if the substring does not congruently match an existing Known
Expect-CT Host’s domain name, per the matching procedure specified in Section
8.2 of <xref target="RFC6797"/>, then the UA MUST add this host to the Known Expect-CT Host
cache. The UA caches:</t>

<t><list style="symbols">
  <t>the Expect-CT Host’s domain name,</t>
  <t>whether the <spanx style="verb">enforce</spanx> directive is present</t>
  <t>the effective expiration date, or enough information to calculate it (the
effective Expect-CT date and the value of the <spanx style="verb">max-age</spanx> directive),</t>
  <t>the value of the <spanx style="verb">report-uri</spanx> directive, if present.</t>
</list></t>

<t>If any other metadata from optional or future Expect-CT header directives are
present in the Expect-CT header, and the UA understands them, the UA MAY note
them as well.</t>

<t>UAs MAY set an upper limit on the value of max-age, so that UAs that have noted
erroneous Expect-CT hosts (whether by accident or due to attack) have some
chance of recovering over time.  If the server sets a max-age greater than the
UA’s upper limit, the UA MAY behave as if the server set the max-age to the UA’s
upper limit.  For example, if the UA caps max-age at 5,184,000 seconds (60
days), and a Pinned Host sets a max- age directive of 90 days in its Expect-CT
header, the UA MAY behave as if the max-age were effectively 60 days. (One way
to achieve this behavior is for the UA to simply store a value of 60 days
instead of the 90-day value provided by the Expect-CT host.)</t>

</section>
<section anchor="http-equiv-meta-element-attribute" title="HTTP-Equiv &lt;meta&gt; Element Attribute">

<t>UAs MUST NOT heed <spanx style="verb">http-equiv="Expect-CT"</spanx> attribute settings on <spanx style="verb">&lt;meta&gt;</spanx>
elements <xref target="W3C.REC-html401-19991224"/> in received content.</t>

</section>
</section>
<section anchor="noting-expect-ct" title="Noting Expect-CT">

<t>Upon receipt of the Expect-CT response header field, the UA notes the host as a
Known Expect-CT Host, storing the host’s domain name and its associated
Expect-CT directives in non-volatile storage. The domain name and associated
Expect-CT directives are collectively known as “Expect-CT metadata”.</t>

<t>The UA MUST note a host as a Known Expect-CT Host if and only if it received the
Expect-CT response header field over an error-free TLS connection, including the
validation added in <xref target="expect-ct-compliance"/>.</t>

<t>To note a host as a Known Expect-CT Host, the UA MUST set its Expect-CT metadata
given in the most recently received valid Expect-CT header.</t>

<t>For forward compatibility, the UA MUST ignore any unrecognized Expect-CT header
directives, while still processing those directives it does
recognize. <xref target="response-header-field-syntax"/> specifies the directives <spanx style="verb">enforce</spanx>,
<spanx style="verb">max-age</spanx>, and <spanx style="verb">report-uri</spanx>, but future specifications and implementations might
use additional directives.</t>

</section>
<section anchor="expect-ct-compliance" title="Evaluating Expect-CT Connections for CT Compliance">

<t>When a UA connects to a Known Expect-CT Host using a TLS connection, if the TLS
connection has errors, the UA MUST terminate the connection without allowing the
user to proceed anyway. (This behavior is the same as that required by
<xref target="RFC6797"/>.)</t>

<t>If the connection has no errors, then the UA will apply an additional
correctness check: compliance with a CT Policy. A UA should evaluate compliance
with its CT Policy whenever connecting to a Known Expect-CT Host, as soon as
possible. It is acceptable to skip this CT compliance check for some hosts
according to local policy. For example, a UA may disable CT compliance checks
for hosts whose validated certificate chain terminates at a user-defined trust
anchor, rather than a trust anchor built-in to the UA (or underlying platform).</t>

<t>If a connection to a Known CT Host violates the UA’s CT policy (i.e. the
connection is not CT-qualified), and if the Known Expect-CT Host’s Expect-CT
metadata indicates an <spanx style="verb">enforce</spanx> configuration, the UA MUST treat the CT
compliance failure as a non-recoverable error.</t>

<t>If a connection to a Known CT Host violates the UA’s CT policy, and if the Known
Expect-CT Host’s Expect-CT metadata includes a <spanx style="verb">report-uri</spanx>, the UA SHOULD send
an Expect-CT report to that <spanx style="verb">report-uri</spanx> (<xref target="reporting-expect-ct-failure"/>).</t>

<t>A UA that has previously noted a host as a Known Expect-CT Host MUST evaluate CT
compliance when setting up the TLS session, before beginning an HTTP
conversation over the TLS channel.</t>

<t>If the UA does not evaluate CT compliance, e.g. because the user has elected to
disable it, or because a presented certificate chain chains up to a user-defined
trust anchor, UAs SHOULD NOT send Expect-CT reports.</t>

</section>
</section>
<section anchor="reporting-expect-ct-failure" title="Reporting Expect-CT Failure">

<t>When the UA attempts to connect to a Known Expect-CT Host and the connection is
not CT-qualified, the UA SHOULD report Expect-CT failures to the <spanx style="verb">report-uri</spanx>,
if any, in the Known Expect-CT Host’s Expect-CT metadata.</t>

<t>When the UA receives an Expect-CT response header field over a connection that
is not CT-qualified, if the UA has not already sent an Expect-CT report for this
connection, then the UA SHOULD report Expect-CT failures to the configured
<spanx style="verb">report-uri</spanx>, if any.</t>

<section anchor="generating-a-violation-report" title="Generating a violation report">

<t>To generate a violation report object, the UA constructs a JSON message of the
following form:</t>

<figure title="JSON format of a violation report object" anchor="violation-report-object"><artwork type="inline"><![CDATA[
{
  "date-time": date-time,
  "hostname": hostname,
  "port": port,
  "effective-expiration-date": expiration-date,
  "served-certificate-chain": [ (MUST be in the order served)
    pem1, ... pemN
  ],
  "validated-certificate-chain": [
    pem1, ... pemN
  ],
  "scts": [
    sct1, ... sctN
  ]
}
]]></artwork></figure>

<t>Whitespace outside of quoted strings is not significant.  The key/value pairs
may appear in any order, but each MUST appear only once.</t>

<t>The <spanx style="verb">date-time</spanx> indicates the time the UA observed the CT compliance failure.
It is provided as a string formatted according to Section 5.6, “Internet
Date/Time Format”, of <xref target="RFC3339"/>.</t>

<t>The <spanx style="verb">hostname</spanx> is the hostname to which the UA made the original request that
failed the CT compliance check. It is provided as a string.</t>

<t>The <spanx style="verb">port</spanx> is the port to which the UA made the original request that failed the
CT compliance check. It is provided as an integer.</t>

<t>The <spanx style="verb">effective-expiration-date</spanx> is the Effective Expiration Date for the
Expect-CT Host that failed the CT compliance check.  It is provided as a string
formatted according to Section 5.6, “Internet Date/Time Format”, of 
<xref target="RFC3339"/>.</t>

<t>The <spanx style="verb">served-certificate-chain</spanx> is the certificate chain, as served by the
Expect-CT Host during TLS session setup.  It is provided as an array of strings,
which MUST appear in the order that the certificates were served; each string
<spanx style="verb">pem1</spanx>, … <spanx style="verb">pemN</spanx> is the Privacy-Enhanced Mail (PEM) representation of each
X.509 certificate as described in <xref target="RFC7468"/>.</t>

<t>The <spanx style="verb">validated-certificate-chain</spanx> is the certificate chain, as constructed by
the UA during certificate chain verification. (This may differ from the
<spanx style="verb">served-certificate-chain</spanx>.) It is provided as an array of strings, which MUST
appear in the order matching the chain that the UA validated; each string
<spanx style="verb">pem1</spanx>, … <spanx style="verb">pemN</spanx> is the Privacy-Enhanced Mail (PEM) representation of each
X.509 certificate as described in <xref target="RFC7468"/>.</t>

<t>The <spanx style="verb">scts</spanx> are JSON messages representing the SCTs (if any) that the UA received
for the Expect-CT host and their validation statuses. The format of <spanx style="verb">sct1</spanx>,
… <spanx style="verb">sctN</spanx> is shown in <xref target="sct-json-format"/>. The SCTs may appear in any order.</t>

<figure title="JSON format of an SCT object" anchor="sct-json-format"><artwork type="inline"><![CDATA[
{
  "sct": sct,
  "status": status,
  "source": source
}
]]></artwork></figure>

<t>The <spanx style="verb">sct</spanx> is as defined in Section 4.1 of RFC 6962 <xref target="RFC6962"/>.</t>

<t>The <spanx style="verb">status</spanx> is a string that the UA MUST set to one of the following values:
“unknown” (indicating that the UA does not have or does not trust the public key
of the log from which the SCT was issued), “valid” (indicating that the UA
successfully validated the SCT as described in Section 5.2 of <xref target="RFC6962"/>), or
“invalid” (indicating that the SCT validation failed because of, e.g., a bad
signature).</t>

<t>The <spanx style="verb">source</spanx> is a string that indicates from where the UA obtained the SCT, as
defined in Section 3.3 of <xref target="RFC6962"/>. The UA MUST set <spanx style="verb">source</spanx> to one
of the following values: “tls-extension”, “ocsp”, or “embedded”.</t>

</section>
<section anchor="sending-a-violation-report" title="Sending a violation report">

<t>When an Expect-CT header field contains the <spanx style="verb">report-uri</spanx> directive, and the
connection does not comply with the UA’s CT Policy, or when the UA connects to a
Known Expect-CT Host with Expect-CT metadata that contains a <spanx style="verb">report-uri</spanx>, the
UA SHOULD report the failure as follows:</t>

<t><list style="numbers">
  <t>Prepare a JSON object <spanx style="verb">report object</spanx> with the single key <spanx style="verb">expect-ct-report</spanx>,
whose value is the result of generating a violation report object as
described in <xref target="violation-report-object"/>.</t>
  <t>Let <spanx style="verb">report body</spanx> by the JSON stringification of <spanx style="verb">report object</spanx>.</t>
  <t>Let <spanx style="verb">report-uri</spanx> be the value of the <spanx style="verb">report-uri</spanx> directive in the Expect-CT
header field.</t>
  <t><eref target="https://html.spec.whatwg.org/#queue-a-task">Queue a task</eref> to
<eref target="https://fetch.spec.whatwg.org/#fetching">fetch</eref> <spanx style="verb">report-uri</spanx>, with the
synchronous flag not set, using HTTP method <spanx style="verb">POST</spanx>, with a <spanx style="verb">Content-Type</spanx>
header field of <spanx style="verb">application/expect-ct-report</spanx>, and an entity body consisting
of <spanx style="verb">report body</spanx>.</t>
</list></t>

</section>
</section>
<section anchor="security-considerations" title="Security Considerations">

<t>When UAs support the Expect-CT header, it becomes a potential vector for hostile
header attacks against site owners. If a site owner uses a certificate issued by
a certificate authority which does not embed SCTs nor serve SCTs via OCSP or TLS
extension, a malicious server operator or attacker could temporarily reconfigure
the host to comply with the UA’s CT policy, and add the Expect-CT header in
enforcing mode with a long <spanx style="verb">max-age</spanx>.  Implementing user agents would note this
as an Expect-CT Host (see  <xref target="noting-expect-ct"/>). After having done this, the
configuration could then be reverted to not comply with the CT policy, prompting
failures. Note this scenario would require the attacker to have substantial
control over the infrastructure in question, being able to obtain different
certificates, change server software, or act as a man-in-the-middle in
connections.</t>

<t>Site operators could themselves only cure this situation by one of:
reconfiguring their web server to transmit SCTs using the TLS extension defined
in Section 3.3 of <xref target="RFC6962"/>, obtaining a certificate from an alternative
certificate authority which provides SCTs by one of the other methods, or by
waiting for the user agents’ persisted notation of this as an Expect-CT host to
reach its <spanx style="verb">max-age</spanx>. User agents may choose to implement mechanisms for users to
cure this situation, as noted in <xref target="usability-considerations"/>.</t>

<section anchor="maximum-max-age" title="Maximum max-age">

<t>There is a security trade-off in that low maximum values provide a narrow window
of protection for users that visit the Known Expect-CT Host only infrequently,
while high maximum values might result in a denial of service to a UA in the
event of a hostile header attack, or simply an error on the part of the
site-owner.</t>

<t>There is probably no ideal maximum for the <spanx style="verb">max-age</spanx> directive. Since Expect-CT
is primarily a policy-expansion and investigation technology rather than an
end-user protection, a value on the order of 30 days (2,592,000 seconds) may be
considered a balance between these competing security concerns.</t>

</section>
<section anchor="avoiding-amplification-attacks" title="Avoiding amplification attacks">

<t>Another kind of hostile header attack uses the <spanx style="verb">report-uri</spanx> mechanism on many
hosts not currently exposing SCTs as a method to cause a denial-of-service to
the host receiving the reports. If some highly-trafficked websites emitted
a non-enforcing Expect-CT header with a <spanx style="verb">report-uri</spanx>, implementing UAs’ reports
could flood the reporting host. It is noted in <xref target="the-report-uri-directive"/> that UAs
should limit the rate at which they emit reports, but an attacker may alter the
Expect-CT header’s fields to induce UAs to submit different reports to different
URIs to still cause the same effect.</t>

</section>
</section>
<section anchor="privacy-considerations" title="Privacy Considerations">

<t>Expect-CT can be used to infer what Certificate Transparency policy is in use,
by attempting to retrieve specially-configured websites which pass one user
agents’ policies but not another’s. Note that this consideration is true of UAs
which enforce CT policies without Expect-CT as well.</t>

<t>Additionally, reports submitted to the <spanx style="verb">report-uri</spanx> could reveal information to
a third party about which webpage is being accessed and by which IP address, by
using individual <spanx style="verb">report-uri</spanx> values for individually-tracked pages. This
information could be leaked even if client-side scripting were disabled.</t>

<t>Implementations must store state about Known Expect-CT Hosts, and hence which
domains the UA has contacted.</t>

<t>Violation reports, as noted in <xref target="reporting-expect-ct-failure"/>, contain
information about the certificate chain that has violated the CT policy. In some
cases, such as organization-wide compromise of the end-to-end security of TLS,
this may include information about the interception tools and design used by the
organization that the organization would otherwise prefer not be disclosed.</t>

<t>Because Expect-CT causes remotely-detectable behavior, it’s advisable that UAs
offer a way for privacy-sensitive users to clear currently noted Expect-CT
hosts, and allow users to query the current state of Known Expect-CT Hosts.</t>

</section>
<section anchor="iana-considerations" title="IANA Considerations">

<t>TBD</t>

</section>
<section anchor="usability-considerations" title="Usability Considerations">

<t>When the UA detects a Known Expect-CT Host in violation of the UA’s CT Policy,
users will experience denials of service. It is advisable for UAs to explain the
reason why.</t>

</section>


  </middle>

  <back>

    <references title='Normative References'>





<reference  anchor='RFC6962' target='http://www.rfc-editor.org/info/rfc6962'>
<front>
<title>Certificate Transparency</title>
<author initials='B.' surname='Laurie' fullname='B. Laurie'><organization /></author>
<author initials='A.' surname='Langley' fullname='A. Langley'><organization /></author>
<author initials='E.' surname='Kasper' fullname='E. Kasper'><organization /></author>
<date year='2013' month='June' />
<abstract><t>This document describes an experimental protocol for publicly logging the existence of Transport Layer Security (TLS) certificates as they are issued or observed, in a manner that allows anyone to audit certificate authority (CA) activity and notice the issuance of suspect certificates as well as to audit the certificate logs themselves.  The intent is that eventually clients would refuse to honor certificates that do not appear in a log, effectively forcing CAs to add all issued certificates to the logs.</t><t>Logs are network services that implement the protocol operations for submissions and queries that are defined in this document.</t></abstract>
</front>
<seriesInfo name='RFC' value='6962'/>
<seriesInfo name='DOI' value='10.17487/RFC6962'/>
</reference>



<reference  anchor='RFC5246' target='http://www.rfc-editor.org/info/rfc5246'>
<front>
<title>The Transport Layer Security (TLS) Protocol Version 1.2</title>
<author initials='T.' surname='Dierks' fullname='T. Dierks'><organization /></author>
<author initials='E.' surname='Rescorla' fullname='E. Rescorla'><organization /></author>
<date year='2008' month='August' />
<abstract><t>This document specifies Version 1.2 of the Transport Layer Security (TLS) protocol.  The TLS protocol provides communications security over the Internet.  The protocol allows client/server applications to communicate in a way that is designed to prevent eavesdropping, tampering, or message forgery.  [STANDARDS-TRACK]</t></abstract>
</front>
<seriesInfo name='RFC' value='5246'/>
<seriesInfo name='DOI' value='10.17487/RFC5246'/>
</reference>



<reference  anchor='RFC2119' target='http://www.rfc-editor.org/info/rfc2119'>
<front>
<title>Key words for use in RFCs to Indicate Requirement Levels</title>
<author initials='S.' surname='Bradner' fullname='S. Bradner'><organization /></author>
<date year='1997' month='March' />
<abstract><t>In many standards track documents several words are used to signify the requirements in the specification.  These words are often capitalized. This document defines these words as they should be interpreted in IETF documents.  This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements.</t></abstract>
</front>
<seriesInfo name='BCP' value='14'/>
<seriesInfo name='RFC' value='2119'/>
<seriesInfo name='DOI' value='10.17487/RFC2119'/>
</reference>



<reference  anchor='RFC2616' target='http://www.rfc-editor.org/info/rfc2616'>
<front>
<title>Hypertext Transfer Protocol -- HTTP/1.1</title>
<author initials='R.' surname='Fielding' fullname='R. Fielding'><organization /></author>
<author initials='J.' surname='Gettys' fullname='J. Gettys'><organization /></author>
<author initials='J.' surname='Mogul' fullname='J. Mogul'><organization /></author>
<author initials='H.' surname='Frystyk' fullname='H. Frystyk'><organization /></author>
<author initials='L.' surname='Masinter' fullname='L. Masinter'><organization /></author>
<author initials='P.' surname='Leach' fullname='P. Leach'><organization /></author>
<author initials='T.' surname='Berners-Lee' fullname='T. Berners-Lee'><organization /></author>
<date year='1999' month='June' />
<abstract><t>HTTP has been in use by the World-Wide Web global information initiative since 1990. This specification defines the protocol referred to as &quot;HTTP/1.1&quot;, and is an update to RFC 2068.  [STANDARDS-TRACK]</t></abstract>
</front>
<seriesInfo name='RFC' value='2616'/>
<seriesInfo name='DOI' value='10.17487/RFC2616'/>
</reference>



<reference  anchor='RFC5234' target='http://www.rfc-editor.org/info/rfc5234'>
<front>
<title>Augmented BNF for Syntax Specifications: ABNF</title>
<author initials='D.' surname='Crocker' fullname='D. Crocker' role='editor'><organization /></author>
<author initials='P.' surname='Overell' fullname='P. Overell'><organization /></author>
<date year='2008' month='January' />
<abstract><t>Internet technical specifications often need to define a formal syntax.  Over the years, a modified version of Backus-Naur Form (BNF), called Augmented BNF (ABNF), has been popular among many Internet specifications.  The current specification documents ABNF. It balances compactness and simplicity with reasonable representational power.  The differences between standard BNF and ABNF involve naming rules, repetition, alternatives, order-independence, and value ranges.  This specification also supplies additional rule definitions and encoding for a core lexical analyzer of the type common to several Internet specifications.  [STANDARDS-TRACK]</t></abstract>
</front>
<seriesInfo name='STD' value='68'/>
<seriesInfo name='RFC' value='5234'/>
<seriesInfo name='DOI' value='10.17487/RFC5234'/>
</reference>



<reference  anchor='RFC7230' target='http://www.rfc-editor.org/info/rfc7230'>
<front>
<title>Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing</title>
<author initials='R.' surname='Fielding' fullname='R. Fielding' role='editor'><organization /></author>
<author initials='J.' surname='Reschke' fullname='J. Reschke' role='editor'><organization /></author>
<date year='2014' month='June' />
<abstract><t>The Hypertext Transfer Protocol (HTTP) is a stateless application-level protocol for distributed, collaborative, hypertext information systems.  This document provides an overview of HTTP architecture and its associated terminology, defines the &quot;http&quot; and &quot;https&quot; Uniform Resource Identifier (URI) schemes, defines the HTTP/1.1 message syntax and parsing requirements, and describes related security concerns for implementations.</t></abstract>
</front>
<seriesInfo name='RFC' value='7230'/>
<seriesInfo name='DOI' value='10.17487/RFC7230'/>
</reference>



<reference  anchor='RFC3986' target='http://www.rfc-editor.org/info/rfc3986'>
<front>
<title>Uniform Resource Identifier (URI): Generic Syntax</title>
<author initials='T.' surname='Berners-Lee' fullname='T. Berners-Lee'><organization /></author>
<author initials='R.' surname='Fielding' fullname='R. Fielding'><organization /></author>
<author initials='L.' surname='Masinter' fullname='L. Masinter'><organization /></author>
<date year='2005' month='January' />
<abstract><t>A Uniform Resource Identifier (URI) is a compact sequence of characters that identifies an abstract or physical resource.  This specification defines the generic URI syntax and a process for resolving URI references that might be in relative form, along with guidelines and security considerations for the use of URIs on the Internet.  The URI syntax defines a grammar that is a superset of all valid URIs, allowing an implementation to parse the common components of a URI reference without knowing the scheme-specific requirements of every possible identifier.  This specification does not define a generative grammar for URIs; that task is performed by the individual specifications of each URI scheme.  [STANDARDS-TRACK]</t></abstract>
</front>
<seriesInfo name='STD' value='66'/>
<seriesInfo name='RFC' value='3986'/>
<seriesInfo name='DOI' value='10.17487/RFC3986'/>
</reference>



<reference  anchor='RFC7234' target='http://www.rfc-editor.org/info/rfc7234'>
<front>
<title>Hypertext Transfer Protocol (HTTP/1.1): Caching</title>
<author initials='R.' surname='Fielding' fullname='R. Fielding' role='editor'><organization /></author>
<author initials='M.' surname='Nottingham' fullname='M. Nottingham' role='editor'><organization /></author>
<author initials='J.' surname='Reschke' fullname='J. Reschke' role='editor'><organization /></author>
<date year='2014' month='June' />
<abstract><t>The Hypertext Transfer Protocol (HTTP) is a stateless \%application- level protocol for distributed, collaborative, hypertext information systems.  This document defines HTTP caches and the associated header fields that control cache behavior or indicate cacheable response messages.</t></abstract>
</front>
<seriesInfo name='RFC' value='7234'/>
<seriesInfo name='DOI' value='10.17487/RFC7234'/>
</reference>



<reference  anchor='RFC6797' target='http://www.rfc-editor.org/info/rfc6797'>
<front>
<title>HTTP Strict Transport Security (HSTS)</title>
<author initials='J.' surname='Hodges' fullname='J. Hodges'><organization /></author>
<author initials='C.' surname='Jackson' fullname='C. Jackson'><organization /></author>
<author initials='A.' surname='Barth' fullname='A. Barth'><organization /></author>
<date year='2012' month='November' />
<abstract><t>This specification defines a mechanism enabling web sites to declare themselves accessible only via secure connections and/or for users to be able to direct their user agent(s) to interact with given sites only over secure connections.  This overall policy is referred to as HTTP Strict Transport Security (HSTS).  The policy is declared by web sites via the Strict-Transport-Security HTTP response header field and/or by other means, such as user agent configuration, for example. [STANDARDS-TRACK]</t></abstract>
</front>
<seriesInfo name='RFC' value='6797'/>
<seriesInfo name='DOI' value='10.17487/RFC6797'/>
</reference>



<reference anchor='W3C.REC-html401-19991224'
           target='http://www.w3.org/TR/1999/REC-html401-19991224'>
<front>
<title>HTML 4.01 Specification</title>

<author initials='D.' surname='Raggett' fullname='Dave Raggett'>
    <organization />
</author>

<author initials='A.' surname='Hors' fullname='Arnaud Le Hors'>
    <organization />
</author>

<author initials='I.' surname='Jacobs' fullname='Ian Jacobs'>
    <organization />
</author>

<date month='December' day='24' year='1999' />
</front>

<seriesInfo name='World Wide Web Consortium Recommendation' value='REC-html401-19991224' />
<format type='HTML' target='http://www.w3.org/TR/1999/REC-html401-19991224' />
</reference>



<reference  anchor='RFC3339' target='http://www.rfc-editor.org/info/rfc3339'>
<front>
<title>Date and Time on the Internet: Timestamps</title>
<author initials='G.' surname='Klyne' fullname='G. Klyne'><organization /></author>
<author initials='C.' surname='Newman' fullname='C. Newman'><organization /></author>
<date year='2002' month='July' />
</front>
<seriesInfo name='RFC' value='3339'/>
<seriesInfo name='DOI' value='10.17487/RFC3339'/>
</reference>



<reference  anchor='RFC7468' target='http://www.rfc-editor.org/info/rfc7468'>
<front>
<title>Textual Encodings of PKIX, PKCS, and CMS Structures</title>
<author initials='S.' surname='Josefsson' fullname='S. Josefsson'><organization /></author>
<author initials='S.' surname='Leonard' fullname='S. Leonard'><organization /></author>
<date year='2015' month='April' />
<abstract><t>This document describes and discusses the textual encodings of the Public-Key Infrastructure X.509 (PKIX), Public-Key Cryptography Standards (PKCS), and Cryptographic Message Syntax (CMS).  The textual encodings are well-known, are implemented by several applications and libraries, and are widely deployed.  This document articulates the de facto rules by which existing implementations operate and defines them so that future implementations can interoperate.</t></abstract>
</front>
<seriesInfo name='RFC' value='7468'/>
<seriesInfo name='DOI' value='10.17487/RFC7468'/>
</reference>




    </references>




  </back>
</rfc>

