rfc-9577

The Privacy Pass HTTP Authentication Scheme

T. Pauly, S. Valdez, C. A. Wood
date2024-06 streamIETF areasec wgprivacypass statusPROPOSED STANDARD pages25 canonicalhttps://www.rfc-editor.org/rfc/rfc9577 doi10.17487/RFC9577
This document defines an HTTP authentication scheme for Privacy Pass, a privacy-preserving authentication mechanism used for authorization. The authentication scheme specified in this document can be used by Clients to redeem Privacy Pass tokens with an Origin. It can also be used by Origins to challenge Clients to present Privacy Pass tokens.

Extracted elements (34)

design-rationale §4.1

GREASE (Generate Random Extensions And Sustain Extensibility) values are reserved in the token types registry, inspired by RFC 8701. Both Clients and Origins can send greased values to ensure implementations handle unknown token types gracefully and remain interoperable with future extensions.

privacy, http

design-rationale §2.2.1

The challenge_digest field in the Token structure is SHA-256 of the original TokenChallenge. Changing the hash algorithm would require a new token type and structure definition, intentionally making algorithm agility explicit and version-controlled rather than implicit.

crypto, privacy

design-rationale §2.1.1.2

The redemption_context field can represent various properties: a per-request nonce (32 random bytes), a time-window-bound value F(time window), a network-bound value F(Client ASN), or a combination. An empty context removes the need for per-context double-spend state but requires global state sharing across all Origin servers.

privacy, security

design-rationale §2.1.4

Token caching is supported so Clients can generate multiple tokens from a single TokenChallenge and store them for future use. This improves privacy by decoupling the time of issuance from the time of redemption, reducing correlation between the two events.

privacy, http

design-rationale §2.1.2.1

When an Origin sends multiple token challenges, it should sort its preferred challenge first as a hint to Clients, since Clients are free to pick any. Challenges SHOULD only mix token types with functionally equivalent properties, as mixing non-equivalent challenges for the same use case is semantically inconsistent.

http, privacy

interoperability-note §2.1.1

Future token types MAY extend or modify both the TokenChallenge and Token structures beyond the defaults defined in this document. The token_type field in each structure acts as the discriminator, and the registry entry defines how the structures differ per type.

http, privacy, registry

normative-requirement §5.1 MUST

All random values in the challenge and token MUST be generated using a cryptographically secure source of randomness (RFC 4086).

security, crypto, privacy

normative-requirement §2.1.1 MUST

All token challenges MUST begin with a 2-octet integer defining the token type in network byte order. Clients MUST ignore challenges with token types they do not support.

http, privacy

normative-requirement §2.1.2 MUST

All unknown or unsupported parameters to 'PrivateToken' authentication credentials MUST be ignored by the recipient. Clients MUST also ignore parameters in challenges not defined for the issuance protocol corresponding to the token type.

http, privacy

normative-requirement §5.2 SHOULD

Applications SHOULD constrain tokens to a single Origin unless the use case can accommodate replay attacks. If token redemption produces side effects, Origins SHOULD implement an anti-replay mechanism.

security, privacy

normative-requirement §2.1.1 MUST

Challenges with redemption_context values of invalid lengths (lengths other than 0 or 32) MUST be ignored by Clients.

http, privacy

normative-requirement §2.1.3 MUST NOT

Clients MUST NOT fetch or redeem a token based on a challenge that fails validation. Validation requires: recognized token_type, well-formed TokenChallenge structure, and (if origin_info is non-empty) the challenging Origin's name appears in origin_info.

http, privacy, security

normative-requirement §2.1.4 SHOULD

Clients SHOULD discard context-bound tokens (those with non-empty redemption_context) upon flushing state such as HTTP cookies or upon a network change when no Origin-specific state is present, to prevent an Origin from using redemption context as a persistent identifier.

privacy, security, http

normative-requirement §3.1 SHOULD

Clients SHOULD have some implementation-specific policy to minimize the number of tokens that can be retrieved by Origins, to defend against token exhaustion attacks where a malicious Origin sends excessive unique challenges.

security, privacy

normative-requirement §2.1.1 MUST

If the origin_info field in a TokenChallenge is non-empty, the Origin that issued the authentication challenge MUST include its own name as one of the names in the list. Comparison is case-insensitive.

http, privacy

normative-requirement §2.2.2 SHOULD

Origins SHOULD implement some form of double-spend prevention that prevents a token with the same nonce from being redeemed twice, to ensure Clients cannot replay tokens for previous challenges.

security, privacy, http

normative-requirement §4.1 SHOULD

Origins SHOULD include random token types from the reserved 'greased' values with some non-trivial probability to prevent Clients from becoming incompatible with new token challenge types.

http, privacy

normative-requirement §4 SHOULD

Origins SHOULD minimize the number of challenges sent to a particular Client context to avoid overwhelming Clients and Issuers with token requests that might cause rate limiting.

privacy, http

normative-requirement §2.1.2 MUST

The base64url values for the challenge and token-key parameters in WWW-Authenticate, and for the token parameter in Authorization, MUST include padding as defined in RFC 4648 Section 3.2.

http, privacy

normative-requirement §3.2 SHOULD

When a Client chooses between multiple token challenges, the choice SHOULD be made in a consistent manner to ensure it does not reveal information about the specific Client.

privacy, http

protocol-element §2.1.1.1

Server names in token challenges are ASCII strings containing hostname and optional port (implied 443 if absent), following URI authority format (RFC 3986 Section 3.2). Names MUST NOT include a userinfo portion. Multiple Origin names in origin_info are comma-delimited without whitespace.

http, privacy

protocol-element §2.2.3

The AuthenticatorInput structure used for token verification consists of token_type (2 octets), nonce (32 octets), challenge_digest (32 octets), and token_key_id (Nid octets). The authenticator in the Token structure is computed over these fields using the issuance protocol corresponding to the token type.

crypto, privacy, security

protocol-element §2.2.2

The Authorization header with 'PrivateToken' scheme carries one parameter, 'token', containing the base64url-encoded Token structure. Clients present this to Origins to redeem (spend) a token. Each token contains a unique Client nonce and a challenge_digest binding it to the specific TokenChallenge.

http, privacy

protocol-element §2

The 'PrivateToken' HTTP authentication scheme allows Clients to redeem Privacy Pass tokens with Origins. Origins challenge Clients via WWW-Authenticate with a TokenChallenge, and Clients respond via Authorization with a redeemed token. The scheme supports multiple token issuance protocols and optional context/Origin binding.

http, privacy, security, registry

protocol-element §2.1.2

The WWW-Authenticate header with 'PrivateToken' scheme carries two mandatory parameters: 'challenge' (base64url-encoded TokenChallenge) and 'token-key' (base64url-encoded Issuer public key). An optional 'max-age' parameter specifies the number of seconds the challenge is valid. The token-key MAY be omitted if Clients can retrieve the key out-of-band.

http, privacy

registry §6.2

IANA has created a new 'Privacy Pass Token Types' registry in a 'Privacy Pass' page. Entries require: Value (2-byte identifier), Name, Token Structure, Token Key Encoding, TokenChallenge Structure, Publicly Verifiable (Y/N), Public Metadata (Y/N), Private Metadata (Y/N), Nk, Nid, Change Controller, Reference, and Notes. Registration policy is Specification Required.

registry, privacy, security

registry §6.1

IANA has registered the 'PrivateToken' authentication scheme in the 'HTTP Authentication Schemes' subregistry of the HTTP Authentication Scheme Registry (RFC 9110 Section 16.4), referencing RFC 9577 Section 2.

registry, http, privacy

registry §6.2.1

The Privacy Pass Token Types registry includes 17 reserved 'GREASE' values (0x0000, 0x02AA, 0x1132, 0x2E96, 0x3CD3, 0x4473, 0x5A63, 0x6D32, 0x7F3F, 0x8D07, 0x916B, 0xA6A4, 0xBEAB, 0xC3F3, 0xDA42, 0xE944, 0xF057) with random-byte token/key/challenge structures to maintain extensibility.

registry, privacy

security-consideration §5.5

Context-bound challenges force token issuance and redemption to occur close in time, enabling a colluding Issuer and Origin to correlate events. Clients MAY introduce delay between challenge receipt and token redemption (using max-age as a guide) to make timing linkability harder.

privacy, security

security-consideration §5.6

Context-bound tokens (non-empty redemption_context) should be discarded when flushing cookies or changing networks. Retaining and redeeming them in a new context allows the Origin to use the redemption context as a tracking cookie, linking otherwise-unlinkable sessions.

privacy, security

security-consideration §5.4

Cross-Origin tokens with empty contexts are vulnerable to token exhaustion: any Origin in the cross-Origin set can deplete the Client's token supply. Scoping tokens to single Origins via non-empty origin_info or client-side rate limits mitigates this. Token matching on origin_info requires exact string equality.

security, privacy

security-consideration §5.3

Cross-Origin tokens with empty redemption contexts can be reflected: an Attacker can relay a TokenChallenge from an Origin to a Client, receive the Client's token, and present it to the Origin as if it were the Client. Per-Origin challenges or non-empty redemption contexts mitigate this attack.

security, privacy

wire-format §2.2.1

The default Token structure contains: token_type (2-octet uint16), nonce (32-octet Client-generated random), challenge_digest (32-octet SHA-256 hash of the original TokenChallenge), token_key_id (Nid-octet key identifier), and authenticator (Nk-octet value cryptographically bound to preceding fields). Nk and Nid are determined by token_type.

http, privacy, security, crypto

wire-format §2.1.1

The TokenChallenge structure contains: token_type (2-octet uint16 in network byte order), issuer_name (ASCII string, length-prefixed with 2-octet uint16), redemption_context (0 or 32 bytes, prefixed with 1-octet length), and origin_info (ASCII string, length-prefixed with 2-octet uint16). Future token types MAY extend this structure.

http, privacy, security