One document matched: draft-williams-websec-session-continue-proto-00.xml
<?xml version="1.0" encoding="UTF-8"?>
<?rfc tocindent="no"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc toc="yes"?>
<?rfc symrefs="yes"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY rfc2119 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY rfc2104 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2104.xml">
<!ENTITY rfc2616 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2616.xml">
<!ENTITY rfc5246 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5246.xml">
<!ENTITY rfc5056 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5056.xml">
<!ENTITY rfc5929 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5929.xml">
<!ENTITY rfc5869 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5869.xml">
<!ENTITY rfc2617 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2617.xml">
<!ENTITY rfc5849 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5849.xml">
<!ENTITY I-D.ietf-oauth-v2 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-oauth-v2.xml">
<!ENTITY I-D.hallambaker-httpintegrity PUBLIC "" "http://xml.resource.org/public/rfc/bibxml3/reference.I-D.hallambaker-httpintegrity.xml">
]>
<rfc docName="draft-williams-websec-session-continue-proto-00" ipr="trust200902" category="std">
<front>
<title abbrev="HTTP Session Problem">Hypertext Transport Protocol (HTTP) Session Continuation Protocol</title>
<author initials="N." surname="Williams" fullname="Nicolas Williams">
<organization abbrev="Cryptonector">Cryptonector, LLC</organization>
<address>
<email>nico@cryptonector.com</email>
</address>
</author>
<date month="January" year="2013"/>
<area>
Security Area
</area>
<keyword>Internet-Draft</keyword>
<abstract>
<t>
One of the most often talked about problems in web security is “cookies”. Web cookies are a method of associating requests with “sessions” that may have been authenticated somehow. Cookies are a form of bearer token that leave much to be desired. This document proposes a session “continuation” protocol for HyperText Transport Protocol (HTTP).</t>
</abstract>
</front>
<middle>
<section title="Introduction" anchor="sec_Introduction">
<t>
The motivation for this protocol is described in <xref target="I-D.williams-websec-session-continue-prob"/>.</t>
<t>
We define a protocol for cryptographic “session continuation” for HyperText Transport Protocol (HTTP) <xref target="RFC2616"/>. Session continuation is the act of binding an HTTP request to a “session”. A “session” consists of all the HTTP requests by a given user (possibly an authenticated user, or possibly an anonymous user). This protocol is a cryptographic protocol that aims to meet all the requirements given in <xref target="I-D.williams-websec-session-continue-prob"/>.</t>
<t>
The protocol consists of:</t>
<t>
<list style="symbols">
<t>
a request header carrying a keyed Message Authentication Code (MAC) that proves possession of a shared session key (shared between the user and the server);</t>
<t>
a response header advertising a default session scope to clients;</t>
<t>
a session identification in the form of a URI;</t>
<t>
an optional facility for server-side statelessness by storing state on the client-side, encrypted in a secret key known to the server;</t>
<t>
a request header for requesting the establishment of a session;</t>
<t>
a response header for indicating the establishment of a session, and including a session URI and any optional state to be repeated by the client.</t>
</list>
</t>
<section title="Conventions used in this document" anchor="d1e316">
<t>
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in <xref target="RFC2119"/>.</t>
</section>
</section>
<section title="Session Keying" anchor="d1e331">
<t>
There are two methods for keying an HTTP session:</t>
<t>
<list style="symbols">
<t>
session keys are output by HTTP authentication;</t>
<t>
or session keys are asserted by the client or the server;</t>
</list>
</t>
<t>
For the key assertion method TLS with confidentiality protection is clearly REQUIRED for security. We've considered the possibility of using Diffie-Hellman key agreement or RSA key transport, but as that would duplicate functionality that is in TLS we consider that out of scope for the time being.</t>
<t>
In either case a single session key is produced, and that is the only key utilized. Having a single key helps reduce session state size and protocol complexity, but we must (and do) distinguish key usage by prefixing a purpose indicator to the MAC input.</t>
<t>
When keys are output by HTTP authentication there may be a key length mismatch. In this case a Key Derivation Function (KDF) <xref target="RFC5869"/> is applied to generate the session key.</t>
<t>
<cref>
We could also use the TLS extractor to generate keys, but that would be an unnecessary complication and would provide very little additional value. Channel binding is achieved per-RFCs 5056 and 5929.</cref>
</t>
<t>
<cref>
Should we have distinct session keys for request and response MACs? Probably, but it increases state size. Better to add a direction indicator to the MAC plaintext.</cref>
</t>
<section title="Mixing HTTP and HTTPS" anchor="d1e368">
<t>
We expect that many sites will continue to mix HTTP and HTTPS for various reasons. To make this possible the MAC input will include a marker indicating HTTP or HTTPS.</t>
</section>
<section title="Authenticated Session Keying" anchor="d1e378">
<t>
When an HTTP client uses HTTP authentication, and the authentication mechanism used can establish a session key, then the client SHOULD request session initiation using a shared session key output by the HTTP authentication mechanism. The client MUST send the session initiation header concurrently with the last HTTP authentication message.</t>
<section title="HTTP/Negotiate Session Keying" anchor="d1e387">
<t>
<cref>
Write text explaining how to use the GSS PRF to exchange keys when using HTTP/Negotiate</cref>
</t>
</section>
<section title="Digest" anchor="d1e396">
<t>
<cref>
Digest could output a session key. Do we want to bother? (Basic certainly can't, or we'd not want it to anyways.)</cref>
</t>
</section>
</section>
<section title="Unauthenticated Session Keying" anchor="d1e405">
<t>
Sessions for unauthenticated users may appear to make little sense at first. This is useful, for example, and just as web cookies are, for tracking “shopping carts” when a user is window shopping, so to speak.</t>
<t>
For unauthenticated session initiation the client merely requests the creation of a session with an asserted session key, for lack of a better choice.</t>
</section>
</section>
<section title="Session Initiation" anchor="d1e417">
<t>
Sessions are always initiated by the client by including a Session-Init header in the client's request carrying the client's proposal for a session.</t>
<t>
Servers that support sessions will respond by creating a session and returning a session ID URI.</t>
<t>
The Session-Init proposal header's value consists of a comma-separated list of proposal parameters:</t>
<t>
</t>
<t>
<figure anchor="magicparlabel-124" title="Session-Init request header">
<artwork> session-param = token "=" ( token | quoted-string )
Session-Init = 1#session-param</artwork>
</figure>
</t>
<t>
The following session parameters are defined:</t>
<t>
<list style="hanging">
<t hangText="Key-Method">
The type of keying: “auth” (key will be output by HTTP authentication), “c-assert” (key is asserted in this Session-Init) or “s-assert” (the server is expected to assert a key). In the “auth” case the Session-Init MUST also carry a nonce and a MAC. This session-param MUST be present.</t>
<t hangText="Key">
The key that the client asserts, if the client asserts a key (Key-Method=c-assert). This may also be included when Key-Method is “auth” in case the server's implementation of HTTP authentication does not output a key, but only when using HTTPS.</t>
<t hangText="Key-Length">
The length of the master session key, as a count of key bits, in base-10. The value MUST NOT be less than 96 or larger than 256. If absent the key length SHALL be 128 bits.</t>
<t hangText="MAC-Algs">
The MAC algorithms supported by the client. This document defines only “HMAC-SHA-1” (HMAC with SHA-1), “HMAC-SHA-1-96” (HMAC with SHA-1 and truncation to 96 bits), “HMAC-SHA256” (HMAC with SHA256), and “HMAC-SHA256-128” (HMAC with SHA256 and truncation to 128 bits). All of these use HMAC <xref target="RFC2104"/>. Clients and servers MUST support HMAC-SHA-1-96 and HMAC-SHA256-128. If absent the default value is “HMAC-SHA256-128”.</t>
<t hangText="KDF-Algs">
A list of KDF algorithms. This is needed only when Key-Method is “auth”. The following are specified here: “HKDF-SHA-1” (HKDF <xref target="RFC5869"/> with SHA-1) and “HKDF-SHA256” (HKDF with SHA256). Clients and servers MUST support HKDF-SHA256. If absent and Key-Method is “auth” then the default value is HKDF-SHA256.</t>
<t hangText="Channel-Binding-Types">
A comma-separated list of channel binding <xref target="RFC5056"/> types. Clients and servers MUST support 'tls-server-end-point' <xref target="RFC5929"/> when using HTTPS. (Note the need to use quoted-string when the list has more than one item.) If absent the default is 'tls-server-end-point'.</t>
<t hangText="Nonce">
A 128-bit nonce, base64-encoded. This session-param MUST be present.</t>
<t hangText="Previous-Session-URI">
The URI of a previous session. See <xref target="sec_Unauthenticated_to_Authenticated"/>.</t>
<t hangText="Previous-Session-State">
The session state for the previous session, if any. See <xref target="sec_Unauthenticated_to_Authenticated"/>.</t>
<t hangText="Unprotected-Allowed">
If present the value MUST be “true”, and indicates that HTTP and HTTPS are both allowed for this session. Otherwise only HTTPS is allowed for this session.</t>
</list>
</t>
<t>
The server responds with a Session-Assign header:</t>
<t>
</t>
<t>
<figure anchor="magicparlabel-170" title="Session-Assign response header">
<artwork> session-params = 1#session-param
Session-Init-Value = <the value of the Session-Init header>
MAC-input = Session-Init-Value "," session-params
MAC = <base64-encoding of MAC taken over the MAC-input>
Session-Assign = session-params ["," MAC]</artwork>
</figure>
</t>
<t>
The MAC is OPTIONAL when using HTTPS, REQUIRED otherwise.</t>
<t>
The session-params for Session-Assign are:</t>
<t>
<list style="hanging">
<t hangText="Key-Method">
If the client requested “auth” as the key method but the server's implementation of HTTP authentication could not output a key then this session-param MUST be present with a value of “c-assert” (if the client included a Key in its Session-Init) or “s-assert” (otherwise).</t>
<t hangText="Key">
The server-asserted key, if the client requested a server-asserted key.</t>
<t hangText="MAC-Alg">
The name of the MAC algorithm selected by the server from the client's proposal (REQUIRED).</t>
<t hangText="KDF-Alg">
The selected KDF algorithm (when the client's selected Key-Method is “auth”).</t>
<t hangText="URI">
The URI of the session (REQUIRED).</t>
<t hangText="State">
Server-side state to be stored on the client (OPTIONAL). Note that servers MAY choose to store server-side state in cookies instead.</t>
<t hangText="Previous-Session">
Indicates whether the previous session was recognized and accepted (“accepted”), rejected (“rejected”), or unknown (“unknown”). This session-param MUST be present when the client's Session-Init had a Previous-Session-URI session-param.</t>
<t hangText="Host-Scope">
A DNS domainname (in A-label form) that the session can be used with. Multiple Scope parameters are allowed. If the domainname starts with a '.' then the session may be used with all server hosts whose domainnames are sub-domains of the given Host-Scope domainname. The server's fully-qualified hostname is always part of the session's host scope.</t>
</list>
</t>
</section>
<section title="Session Scope: Sharing Sessions Across Servers" anchor="sec_Session_Scope__Sharing">
<t>
A service might be composed of multiple related servers, each with a different hostname. As a result the service may require a client to use the same session across the service's component servers. We provide a mechanism by which the server may indicate a set of such servers to the client: the Host-Scope session-param in the server's Session-Assign response header.</t>
<t>
[XXX We need a way to constrain this for privacy protection reasons. It's not yet clear how the client can judge which Host-Scope paramters to accept or ignore, only that must be allowed to do so.]</t>
<t>
To facilitate interoperable session sharing across heterogeneous server implementations we define a session resource -named by its session URI- that can be obtained with a properly-authenticated GET by authorized entities. The session resource's representation is a application/json document type, containing a JSON-serialized associative array with the following REQUIRED keys:</t>
<t>
<list style="hanging">
<t hangText="Master-Key">
The session's master key, base64-encoded.</t>
<t hangText="MAC-Alg">
The MAC algorithm for this session.</t>
</list>
</t>
<t>
<cref>
We probably want each server to see a different master key, in which case we probably want to use a KDF with the server's hostname as part of the salt.</cref>
</t>
<t>
<cref>
We probably want to define some OPTIONAL keys for this object, such as “User”, “User-URI”, “HTTP-Auth-Scheme-Used”, “HTTP-Auth-Scheme-<param>”, and so on, as well as an application-specific namespace of keys (e.g., “App-<appname>” or “<URN>”).</cref>
</t>
</section>
<section title="Unauthenticated to Authenticated Session Upgrade" anchor="sec_Unauthenticated_to_Authenticated">
<t>
A client might first establish an unauthenticated session then authenticate the user later. When authentication is done the client might wish to preserve any state associated with the preceding unauthenticated session. The client does this by sending a Session-Init at authentication time with a 'Previous-Session-URI' session-param and, if there was server-assigned session state, a 'Previous-Session-State' session-param.</t>
</section>
<section title="Session Continuation" anchor="d1e660">
<t>
Once a session is established the client binds requests to sessions as described here.</t>
<t>
There are two cases: HTTPS and HTTP. In both cases the client adds a header</t>
<t>
For the HTTPS case the client adds a “Session” header to its requests with the following content: the session identifier assigned by the server, a nonce generated by the client, and a MAC of the nonce and the TLS channel bindings.</t>
<t>
The value of the Session header consists of a base64-encoded 128-bit nonce and a MAC, using the session's MAC algorithm, of the nonce and the channel binding, each base64-encoded then concatenated in that order:</t>
<t>
</t>
<t>
<figure anchor="magicparlabel-219" title="Session header">
<artwork> CB = <base64-encoding of the channel bindings>
nonce = <base64-encoded 128-bit nonce>
new-state = ...
direction = "c2s" | "s2c"
prot-state = "protected" | "unprotected"
response-status = "" | "Invalid-MAC" |
| "Session-expired" "Session-unknown"
MAC-input = direction "," prot-state "," nonce
"," CB "," status "," [new-state]
MAC = <base64encoded MAC taken over MAC-input>
Session = nonce "," response-status "," [new-state] "," MAC</artwork>
</figure>
</t>
<t>
Where the response must carry a Session header, the form of the value is the same as for requests.</t>
<t>
The MAC is taken over a direction indicator, an indicator of whether TLS is used, the nonce, the channel bindings, and so on, as shown in Figure 3. Only the server may assert new session state, and only the server indicates a response-status other than “” (empty string).</t>
<section title="Session Validation and Error Handling" anchor="d1e706">
<t>
The receiver computes the same MAC using the sender's nonce (and new-state, if present, when the receiver is the client) and compares the resulting MAC to the MAC from the Session header.</t>
<t>
If MAC validation of a request fails then the server MUST respond with a 403 status code with a non-empty response-status int he Session-header. Error responses MUST include a Session header. If 403 response's Session header indicates “Invalid-MAC” then if the client had used HTTPS then the client SHOULD warn the user, otherwise the client SHOULD retry. If the 403 response's Session header indicates “Session-expired” then the client SHOULD renew the session (see <xref target="sub_Session_Expiration_and"/>). Otherwise the client must assume that the old session has been destroyed (e.g., because of a logout or server state data loss) and may establish a new session.</t>
<t>
If MAC validation of a response fails the the client MUST act as though a 400 (bad request) had been sent instead. If the request was idempotent the client SHOULD retry, otherwise recovery is not specified.</t>
</section>
<section title="Session Expiration and Renewal" anchor="sub_Session_Expiration_and">
<t>
If the server decides that a session is no longer valid then the server should respond with a 401 status code. The client should then re-authenticate or establish a new unauthenticated session, using the Previous-Session-URI and Previous-Session-State session-params of the new Session-Init to indicate that the old session is being “renewed”.</t>
</section>
<section title="Alternative: Define Session Scheme for WWW-Authenticate" anchor="d1e736">
<t>
One possibility that has some appeal would be to define a new HTTP authentication scheme called “Session” (say) and use that instead of the “Session” header defined above. The primary advantage to the WWW-Authenticate approach is that it fits the existing HTTP authentication framework, allowing a server to present to an application the user authentication information embedded in the session state as if the user were re-authenticated in each request. Session continuation can then be seen as a form of fast re-authentication.</t>
</section>
</section>
<section title="Logout" anchor="d1e745">
<t>
To logout the client SHOULD perform a DELETE of the session URI.</t>
</section>
<section title="Inquiring Session Status" anchor="d1e754">
<t>
The client MAY do a GET of the session URI. The semantics of the response body for this are not specified here. As explained in <xref target="sec_Session_Scope__Sharing"/>, servers also may GET a session URI; see <xref target="sec_Session_Scope__Sharing"/> for more details.</t>
</section>
<section title="Analysis" anchor="sec_Analysis">
<t>
Quite clearly this protocol meets requirements 1, 2, 3, 5, and 11 from <xref target="I-D.williams-websec-session-continue-prob"/>.</t>
<t>
The security requirements are also met:</t>
<t>
<list style="hanging">
<t hangText="requirement 4">
The active cookie recovery attacks on TLS we consider are adaptive chosen plaintext attacks. These attacks depend on the cookies sent by the client being the same in every request. This protocol uses MAC of at least channel bindings data (which doesn't change for any one connection) salted (so to speak) with a nonce. This use of nonces causes the MAC sent to be different for each request, which defeats the known cookie recovery attacks on TLS. Note that we assume confidentiality protection from TLS; clients MUST NOT negotiate cipher suites that provide no confidentiality protection.</t>
<t hangText="requirement 6">
This is clearly met by the use of a MAC keyed with a session key not available to attackers. This clearly depends on implementations having decent entropy sources, but this is no different than for TLS. Note, however, that insecure session initiation with key assertion is clearly insecure relative to passive attackers, as well as active attackers that can redirect packet flows so they can observe session initiation.</t>
<t hangText="requirement_7">
This is clearly met by prefixing an indicator of whether TLS is used or not to the MAC input.</t>
<t hangText="requirement_8">
The use of channel bindings as an input to the MAC meets this requirement.</t>
<t hangText="requirement_9">
This requirement is clearly met by having DELETE of a session URI terminate a session. It is important that clients promptly destroy any remnant of deleted sessions' state so that servers get no benefit from not deleting sessions when the clients demand it.</t>
<t hangText="requirement_10">
This is clearly met by using headers that proxies should pass unmodified.</t>
</list>
</t>
</section>
<section title="IANA Considerations" anchor="sec_IANA_Considerations">
<t>
This document creates a number of new HTTP request and response headers. These headers will need to be added to the HTTP header registry: <TBD>.</t>
</section>
<section title="Security Considerations" anchor="sec_Security_Considerations">
<t>
This session continuation protocol appears to meet the requirements outlined in <xref target="I-D.williams-websec-session-continue-prob"/>. [XXX Add analysis. In particular explain how MAC(CB + nonce) is sufficient to defeat BEAST and CRIME.]</t>
<t>
This proposal meets security requirements from the problem statement <xref target="I-D.williams-websec-session-continue-prob"/>. See <xref target="sec_Analysis"/> for details.</t>
<t>
[...]</t>
</section>
</middle>
<back>
<references title="Normative References" anchor="d1e865">&rfc2119;
&rfc2104;
&rfc2616;
&rfc5246;
&rfc5056;
&rfc5929;
&rfc5869;
<reference anchor="I-D.williams-websec-session-continue-prob"><front><title>Hypertext Transport Protocol (HTTP) Session Continuation: Problem Statement</title><author initials="N." surname="Williams" fullname="Nicolas Williams"><organization/></author><date month="January" day="1" year="2013"/><abstract><t>Abstract One of the most often talked about problems in web security is “cookies”. Web cookies are a method of associating requests with “sessions” that may have been authenticated somehow. Cookies are a form of bearer token that leave much to be desired. This document describes the session “continuation” problem for the HyperText Transport Protocol (HTTP).</t></abstract></front><seriesInfo name="Internet-Draft" value="draft-williams-websec-session-continue-prob-00"/><format type="TXT" target="http://www.ietf.org/internet-drafts/draft-draft-williams-websec-session-continue-prob-00.txt"/></reference> </references>
<references title="Informative References" anchor="sec_Normative_References">&rfc2617;
&rfc5849;
&I-D.ietf-oauth-v2;
&I-D.hallambaker-httpintegrity;
</references>
</back>
</rfc>
| PAFTECH AB 2003-2026 | 2026-04-24 01:06:39 |