Internet-Draft | HTTP Unprompted Authentication | February 2023 |
Schinazi, et al. | Expires 28 August 2023 | [Page] |
Existing HTTP authentication mechanisms are probeable in the sense that it is possible for an unauthenticated client to probe whether an origin serves resources that require authentication. It is possible for an origin to hide the fact that it requires authentication by not generating Unauthorized status codes, however that only works with non-cryptographic authentication schemes: cryptographic schemes (such as signatures or message authentication codes) require a fresh nonce to be signed, and there is no existing way for the origin to share such a nonce without exposing the fact that it serves resources that require authentication. This document proposes a new non-probeable cryptographic authentication scheme.¶
This note is to be removed before publishing as an RFC.¶
Status information for this document may be found at https://datatracker.ietf.org/doc/draft-ietf-httpbis-unprompted-auth/.¶
Discussion of this document takes place on the HTTP Working Group mailing list (mailto:ietf-http-wg@w3.org), which is archived at https://lists.w3.org/Archives/Public/ietf-http-wg/. Working Group information can be found at https://httpwg.org/.¶
Source for this draft and an issue tracker can be found at https://github.com/httpwg/http-extensions/labels/unprompted-auth.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 28 August 2023.¶
Copyright (c) 2023 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
Existing HTTP authentication mechanisms (see Section 11 of [HTTP]) are probeable in the sense that it is possible for an unauthenticated client to probe whether an origin serves resources that require authentication. It is possible for an origin to hide the fact that it requires authentication by not generating Unauthorized status codes, however that only works with non-cryptographic authentication schemes: cryptographic schemes (such as signatures or message authentication codes) require a fresh nonce to be signed, and there is no existing way for the origin to share such a nonce without exposing the fact that it serves resources that require authentication. This document proposes a new non-probeable cryptographic authentication scheme.¶
There are scenarios where servers may want to expose the fact that authentication is required for access to specific resources. This is left for future work.¶
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 BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
This document uses the following terminology from Section 3 of [STRUCTURED-FIELDS] to specify syntax and parsing: Integer and Byte Sequence.¶
This document only defines the Signature and HMAC authentication schemes for uses of HTTP with TLS [TLS]. This includes any use of HTTP over TLS as typically used for HTTP/2 [HTTP/2], or HTTP/3 [HTTP/3] where the transport protocol uses TLS as its authentication and key exchange mechanism [QUIC-TLS].¶
The user agent leverages a TLS keying material exporter [KEY-EXPORT] to generate a nonce which can be signed using the user's key. The keying material exporter uses a label that starts with the characters "EXPORTER-HTTP-Unprompted-Authentication-" (see Section 5 for the labels and contexts used by each scheme). The TLS keying material exporter is used to generate a 32-byte key which is then used as a nonce.¶
The "Unprompted-Authentication" header field allows a user agent to authenticate with an origin server. The authentication is scoped to the HTTP request associated with this header field. The value of the Unprompted-Authentication header field is a credentials object, as defined in Section 11.4 of [HTTP]. Credentials contain an authentication scheme followed by optional authentication parameters.¶
This specification defines the following authentication parameters, they can be used by the authentication schemes defined in Section 5.¶
The OPTIONAL "u" (user ID) parameter is a byte sequence that specifies the user ID that the user agent wishes to authenticate.¶
The OPTIONAL "p" (proof) parameter is a byte sequence that specifies the proof that the user agent provides to attest to possessing the credential that matches its user ID.¶
The OPTIONAL "s" (signature) parameter is an integer that specifies the signature algorithm used to compute the proof transmitted in the "p" directive. Its value is an integer between 0 and 255 inclusive from the IANA "TLS SignatureAlgorithm" registry maintained at <https://www.iana.org/assignments/tls-parameters#tls-parameters-16>.¶
The OPTIONAL "h" (hash) parameter is an integer that specifies the hash algorithm used to compute the proof transmitted in the "p" directive. Its value is an integer between 0 and 255 inclusive from the IANA "TLS HashAlgorithm" registry maintained at <https://www.iana.org/assignments/tls-parameters#tls-parameters-18>.¶
This document defines the "Signature" and "HMAC" HTTP authentication schemes.¶
The "Signature" HTTP Authentication Scheme uses asymmetric cyptography. User agents possess a user ID and a public/private key pair, and origin servers maintain a mapping of authorized user IDs to their associated public keys. When using this scheme, the "u", "p", and "s" parameters are REQUIRED. The TLS keying material export label for this scheme is "EXPORTER-HTTP-Unprompted-Authentication-Signature" and the associated context is empty. The nonce is then signed using the selected asymmetric signature algorithm and transmitted as the proof directive.¶
For example, the user ID "john.doe" authenticating using Ed25519 [ED25519] could produce the following header field (lines are folded to fit):¶
Unprompted-Authentication: Signature u=:am9obi5kb2U=:;s=7; p=:SW5zZXJ0IHNpZ25hdHVyZSBvZiBub25jZSBoZXJlIHdo aWNoIHRha2VzIDUxMiBiaXRzIGZvciBFZDI1NTE5IQ==:¶
The "HMAC" HTTP Authentication Scheme uses symmetric cyptography. User agents possess a user ID and a secret key, and origin servers maintain a mapping of authorized user IDs to their associated secret key. When using this scheme, the "u", "p", and "h" parameters are REQUIRED. The TLS keying material export label for this scheme is "EXPORTER-HTTP-Unprompted-Authentication-HMAC" and the associated context is empty. The nonce is then HMACed using the selected HMAC algorithm and transmitted as the proof directive.¶
For example, the user ID "john.doe" authenticating using HMAC-SHA-512 [SHA] could produce the following header field (lines are folded to fit):¶
Unprompted-Authentication: HMAC u="am9obi5kb2U=";h=6; p="SW5zZXJ0IEhNQUMgb2Ygbm9uY2UgaGVyZSB3aGljaCB0YWtl cyA1MTIgYml0cyBmb3IgU0hBLTUxMiEhISEhIQ=="¶
The HTTP Authentication Scheme registry maintained by IANA at <https://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml> contains entries not defined in this document. Those entries MAY be used with Unprompted Authentication.¶
Since the Signature and HMAC HTTP Authentication Schemes leverage TLS keying material exporters, their output cannot be transparently forwarded by HTTP intermediaries. HTTP intermediaries that support this specification will validate the authentication received from the client themselves, then inform the upstream HTTP server of the presence of valid authentication using some other mechanism.¶
Unprompted Authentication allows a user-agent to authenticate to an origin server while guaranteeing freshness and without the need for the server to transmit a nonce to the user agent. This allows the server to accept authenticated clients without revealing that it supports or expects authentication for some resources. It also allows authentication without the user agent leaking the presence of authentication to observers due to clear-text TLS Client Hello extensions.¶
The authentication proofs described in this document are not bound to individual HTTP requests; if the same user sends an authentication proof on multiple requests they will all be identical. This allows for better compression when sending over the wire, but implies that client implementations that multiplex different security contexts over a single HTTP connection need to ensure that those contexts cannot read each other's header fields. Otherwise, one context would be able to replay the unprompted authentication header field of another. This constraint is met by modern Web browsers. If an attacker were to compromise the browser such that it could access another context's memory, the attacker might also be able to access the corresponding key, so binding authentication to requests would not provide much benefit in practice.¶
This document will request IANA to register the following entry in the "HTTP Field Name" registry maintained at <https://www.iana.org/assignments/http-fields>:¶
This document, if approved, requests IANA to add two new entries to the "HTTP Authentication Schemes" Registry maintained at <https://www.iana.org/assignments/http-authschemes>. Both entries have the Reference set to this document, and the Notes empty. The Authentication Scheme Name of the entries are:¶
This document, if approved, requests IANA to register the following entries in the "TLS Exporter Labels" registry maintained at <https://www.iana.org/assignments/tls-parameters#exporter-labels>:¶
Both of these entries are listed with the following qualifiers:¶
The authors would like to thank many members of the IETF community, as this document is the fruit of many hallway conversations. Ben Schwartz contributed ideas to this document.¶