Internet-Draft HTTP Unprompted Authentication March 2023
Schinazi, et al. Expires 14 September 2023 [Page]
Workgroup:
HTTPBIS
Internet-Draft:
draft-ietf-httpbis-unprompted-auth-01
Published:
Intended Status:
Standards Track
Expires:
Authors:
D. Schinazi
Google LLC
D. Oliver
Guardian Project
J. Hoyland
Cloudflare Inc.

HTTP Unprompted Authentication

Abstract

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.

About This Document

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.

Status of This Memo

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 14 September 2023.

Table of Contents

1. Introduction

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.

Unprompted Authentication serves use cases in which a site wants to offer a service or capability only to "those who know" while all others are given no indication the service or capability exists. The conceptual model is that of a "speakeasy". "Knowing" is via an externally-defined mechanism by which keys are distributed. For example, a company might offer remote employee access to company services directly via its website using their employee credentials, or offer access to limited special capabilities for specific employees, while making discovering (probing for) such capabilities difficult. Members of less well-defined communities might use more ephemeral keys to acquire access to geography- or capability-specific resources, as issued by an entity whose user base is larger than the available resources can support (by having that entity metering the availability of keys temporally or geographically). Unprompted Authentication is also useful for cases where a service provider wants to distribute user-provisioning information for its resources without exposing the provisioning location to non-users.

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.

1.1. Conventions and Definitions

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.

2. Computing the Authentication Proof

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 chosen 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.

Because the TLS keying material exporter is only secure for authentication when it is uniquely bound to the TLS session [RFC7627], the Signature and HMAC authentication schemes require either one of the following properties:

Clients MUST NOT use the Signature and HMAC authentication schemes on connections that do not meet one of the two properties above. If a server receives a request that uses these authentication schemes on a connection that meets neither of the above properties, the server MUST treat the request as malformed.

3. Header Field Definition

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.

4. Authentication Parameters

This specification defines the following authentication parameters, they can be used by the authentication schemes defined in Section 5.

4.1. The k Parameter

The OPTIONAL "k" (key ID) parameter is a byte sequence that identifies which key the user agent wishes to use to authenticate. This can for example be used to point to an entry into a server-side database of known keys.

4.2. The p Parameter

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 key ID.

4.3. The s Parameter

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>.

4.4. The h Parameter

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>.

5. Authentication Schemes

This document defines the "Signature" and "HMAC" HTTP authentication schemes.

5.1. Signature

The "Signature" HTTP Authentication Scheme uses asymmetric cryptography. User agents possess a key ID and a public/private key pair, and origin servers maintain a mapping of authorized key IDs to their associated public keys. When using this scheme, the "k", "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 key ID "basement" authenticating using Ed25519 [ED25519] could produce the following header field (lines are folded to fit):

Unprompted-Authentication: Signature k=:YmFzZW1lbnQ=:;s=7;
p=:SW5zZXJ0IHNpZ25hdHVyZSBvZiBub25jZSBoZXJlIHdo
aWNoIHRha2VzIDUxMiBiaXRzIGZvciBFZDI1NTE5IQ==:

5.2. HMAC

The "HMAC" HTTP Authentication Scheme uses symmetric cryptography. User agents possess a key ID and a secret key, and origin servers maintain a mapping of authorized key IDs to their associated secret key. When using this scheme, the "k", "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 key ID "basement" authenticating using HMAC-SHA-512 [SHA] could produce the following header field (lines are folded to fit):

Unprompted-Authentication: HMAC k="YmFzZW1lbnQ=";h=6;
p="SW5zZXJ0IEhNQUMgb2Ygbm9uY2UgaGVyZSB3aGljaCB0YWtl
cyA1MTIgYml0cyBmb3IgU0hBLTUxMiEhISEhIQ=="

5.3. Other HTTP Authentication Schemes

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.

6. Server Handling

Servers that wish to introduce resources whose existence cannot be probed need to ensure that they do not reveal any information about those resources to unauthenticated clients. In particular, such servers MUST respond to authentication failures with the exact same response that they would have used for non-existent resources. For example, this can mean using HTTP status code 404 (Not Found) instead of 401 (Unauthorized). Such authentication failures can be caused for example by: * absence of the Unprompted-Authentication field * failure to parse the Unprompted-Authentication field * use of Unprompted Authentication with an unknown key ID * failure to validate the signature or MAC.

Such servers MUST also ensure that the timing of their request handling does not leak any information. This can be accomplished by delaying responses to all non-existent resources such that the timing of the authentication verification is not observable.

7. Intermediary Considerations

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 have two options:

The mechanism for the intermediary to communicate this information to the upstream HTTP server is out of scope for this document.

8. Security Considerations

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 key is used for authentication proofs 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.

Key material used for authentication in unprompted authentication, whether symmetric or asymmetric MUST NOT be reused in other protocols. Doing so can undermine the security guarantees of the authentication.

Sites offering Unprompted Authentication are able to link requests that use the same key for the Authentication Schemes provided. However, requests are not linkable across other sites if the keys used are private to the individual sites using Unprompted Authentication.

9. IANA Considerations

9.1. Unprompted-Authentication Header Field

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>:

Field Name:

Unprompted-Authentication

Template:

None

Status:

provisional (permanent if this document is approved)

Reference:

This document

Comments:

None

9.2. HTTP Authentication Schemes Registry

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:

  • Signature
  • HMAC

9.3. TLS Keying Material Exporter Labels

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>:

  • EXPORTER-HTTP-Unprompted-Authentication-Signature
  • EXPORTER-HTTP-Unprompted-Authentication-HMAC

Both of these entries are listed with the following qualifiers:

DTLS-OK:

N

Recommended:

Y

Reference:

This document

10. References

10.1. Normative References

[HTTP]
Fielding, R., Ed., Nottingham, M., Ed., and J. Reschke, Ed., "HTTP Semantics", STD 97, RFC 9110, DOI 10.17487/RFC9110, , <https://www.rfc-editor.org/rfc/rfc9110>.
[KEY-EXPORT]
Rescorla, E., "Keying Material Exporters for Transport Layer Security (TLS)", RFC 5705, DOI 10.17487/RFC5705, , <https://www.rfc-editor.org/rfc/rfc5705>.
[RFC2119]
Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, , <https://www.rfc-editor.org/rfc/rfc2119>.
[RFC7627]
Bhargavan, K., Ed., Delignat-Lavaud, A., Pironti, A., Langley, A., and M. Ray, "Transport Layer Security (TLS) Session Hash and Extended Master Secret Extension", RFC 7627, DOI 10.17487/RFC7627, , <https://www.rfc-editor.org/rfc/rfc7627>.
[RFC8174]
Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, , <https://www.rfc-editor.org/rfc/rfc8174>.
[STRUCTURED-FIELDS]
Nottingham, M. and P-H. Kamp, "Structured Field Values for HTTP", RFC 8941, DOI 10.17487/RFC8941, , <https://www.rfc-editor.org/rfc/rfc8941>.
[TLS]
Rescorla, E., "The Transport Layer Security (TLS) Protocol Version 1.3", RFC 8446, DOI 10.17487/RFC8446, , <https://www.rfc-editor.org/rfc/rfc8446>.

10.2. Informative References

[ED25519]
Josefsson, S. and J. Schaad, "Algorithm Identifiers for Ed25519, Ed448, X25519, and X448 for Use in the Internet X.509 Public Key Infrastructure", RFC 8410, DOI 10.17487/RFC8410, , <https://www.rfc-editor.org/rfc/rfc8410>.
[HTTP/2]
Thomson, M., Ed. and C. Benfield, Ed., "HTTP/2", RFC 9113, DOI 10.17487/RFC9113, , <https://www.rfc-editor.org/rfc/rfc9113>.
[HTTP/3]
Bishop, M., Ed., "HTTP/3", RFC 9114, DOI 10.17487/RFC9114, , <https://www.rfc-editor.org/rfc/rfc9114>.
[QUIC-TLS]
Thomson, M., Ed. and S. Turner, Ed., "Using TLS to Secure QUIC", RFC 9001, DOI 10.17487/RFC9001, , <https://www.rfc-editor.org/rfc/rfc9001>.
[SHA]
Eastlake 3rd, D. and T. Hansen, "US Secure Hash Algorithms (SHA and SHA-based HMAC and HKDF)", RFC 6234, DOI 10.17487/RFC6234, , <https://www.rfc-editor.org/rfc/rfc6234>.

Acknowledgments

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.

Authors' Addresses

David Schinazi
Google LLC
1600 Amphitheatre Parkway
Mountain View, CA 94043
United States of America
David M. Oliver
Guardian Project
Jonathan Hoyland
Cloudflare Inc.