MASQUE Obfuscation
Google LLC
1600 Amphitheatre Parkway
Mountain View, California 94043
United States of America
dschinazi.ietf@gmail.com
Internet-Draft
This document describes MASQUE Obfuscation. MASQUE Obfuscation is a mechanism
that allows co-locating and obfuscating networking applications behind an
HTTPS web server. The currently prevalent use-case is to allow running a proxy
or VPN server that is indistinguishable from an HTTPS server to any
unauthenticated observer. We do not expect major providers and CDNs to deploy
this behind their main TLS certificate, as they are not willing to take the
risk of getting blocked, as shown when domain fronting was blocked. An
expected use would be for individuals to enable this behind their personal
websites via easy to configure open-source software.
This document is a straw-man proposal. It does not contain enough details to
implement the protocol, and is currently intended to spark discussions on
the approach it is taking. Discussion of this work is encouraged to happen on
the MASQUE IETF mailing list masque@ietf.org or on the GitHub repository
which contains the draft: https://github.com/DavidSchinazi/masque-drafts.
Introduction
This document describes MASQUE Obfuscation. MASQUE Obfuscation is a mechanism
that allows co-locating and obfuscating networking applications behind an
HTTPS web server. The currently prevalent use-case is to allow running a proxy
or VPN server that is indistinguishable from an HTTPS server to any
unauthenticated observer. We do not expect major providers and CDNs to deploy
this behind their main TLS certificate, as they are not willing to take the
risk of getting blocked, as shown when domain fronting was blocked. An
expected use would be for individuals to enable this behind their personal
websites via easy to configure open-source software.
This document is a straw-man proposal. It does not contain enough details to
implement the protocol, and is currently intended to spark discussions on
the approach it is taking. Discussion of this work is encouraged to happen on
the MASQUE IETF mailing list masque@ietf.org or on the GitHub repository
which contains the draft: https://github.com/DavidSchinazi/masque-drafts.
MASQUE Obfuscation is built upon the MASQUE protocol
. MASQUE Obfuscation leverages the efficient
head-of-line blocking prevention features of the QUIC transport protocol
when MASQUE Obfuscation is used in an HTTP/3
server. MASQUE Obfuscation can also run in an
HTTP/2 server but at a performance cost.
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
when, and only when, they appear in all capitals, as shown here.
Usage Scenarios
There are currently multiple usage scenarios that can benefit from MASQUE
Obfuscation.
Protection from Network Providers
Some users may wish to obfuscate the destination of their network traffic from
their network provider. This prevents network providers from using data
harvested from this network traffic in ways the user did not intend.
Protection from Web Servers
There are many clients who would rather not establish a direct connection to
web servers, for example to avoid location tracking. The clients can do that
by running their traffic through a MASQUE Obfuscation server. The web server
will only see the IP address of the MASQUE Obfuscation server, not that of the
client.
Onion Routing
Routing traffic through a MASQUE Obfuscation server only provides partial
protection against tracking, because the MASQUE Obfuscation server knows the
address of the client. Onion routing as it exists today mitigates this issue
for TCP/TLS. A MASQUE Obfuscation server could allow onion routing over QUIC.
In this scenario, the client establishes a connection to the MASQUE
Obfuscation server, then through that to another MASQUE Obfuscation server,
etc. This creates a tree of MASQUE servers rooted at the client. QUIC
connections are mapped to a specific branch of the tree. The first MASQUE
Obfuscation server knows the actual address of the client, but the other
MASQUE Obfuscation servers only know the address of the previous server.
To assure reasonable privacy, the path should include at least 3 MASQUE
Obfuscation servers.
Requirements
This section describes the goals and requirements chosen for MASQUE
Obfuscation.
Invisibility of Usage
An authenticated client using MASQUE Obfuscation appears to observers as a
regular HTTPS client. Observers only see that HTTP/3 or HTTP/2 is being used
over an encrypted channel. No part of the exchanges between client and server
may stick out. Note that traffic analysis is discussed in .
Invisibility of the Server
To anyone without private keys, the server is indistinguishable from a regular
web server. It is impossible to send an unauthenticated probe that the server
would reply to differently than if it were a normal web server.
Fallback to HTTP/2 over TLS over TCP
When QUIC is blocked, MASQUE Obfuscation can run over TCP and still satisfy
previous requirements. Note that in this scenario performance may be
negatively impacted.
Overview of the Mechanism
The server runs an HTTPS server on port 443, and has a valid TLS certificate
for its domain. The client has a public/private key pair, and the server
maintains a list of authorized MASQUE Obfuscation clients, and their public
key. (Alternatively, clients can also be authenticated using a shared secret.)
The client starts by establishing a regular HTTPS connection to the server
(HTTP/3 over QUIC or HTTP/2 over TLS 1.3 over TCP), and
validates the server's TLS certificate as it normally would for HTTPS. If
validation fails, the connection is aborted. At this point the client can send
regular unauthenticated HTTP requests to the server. When it wishes to start
MASQUE Obfuscation, the client uses HTTP Transport Authentication
to prove its possession
of its associated key. The client sends the Transport-Authentication header
alongside its MASQUE Negotiation request.
When the server receives the MASQUE Negotiation request, it authenticates the
client and if that fails responds with code "404 Not Found", making sure its
response is the same as what it would return for any unexpected POST
request. If authentication succeeds, the server sends its list of supported
MASQUE applications and the client can start using them.
Connection Resumption
Clients MUST NOT attempt to "resume" MASQUE Obfuscation state similarly to how
TLS sessions can be resumed. Every new QUIC or TLS connection requires fully
authenticating the client and server. QUIC 0-RTT and TLS early data MUST
NOT be used with MASQUE Obfuscation as they are not forward secure.
Path MTU Discovery
In the main deployment of this mechanism, QUIC will be used between client
and server, and that will most likely be the smallest MTU link in the path
due to QUIC header and authentication tag overhead. The client is responsible
for not sending overly large UDP packets and notifying the server of the low
MTU. Therefore PMTUD is currently seen as out of scope of this document.
Operation over HTTP/2
We will need to define the details of how to run MASQUE over HTTP/2.
When running over HTTP/2, MASQUE uses the Extended CONNECT method to negotiate
the use of datagrams over an HTTP/2 stream
.
MASQUE Obfuscation implementations SHOULD discover that HTTP/3 is available
(as opposed to only HTTP/2) using the same mechanism as regular HTTP traffic.
This current standardized mechanism for this is HTTP Alternative Services
, but future mechanisms such as
can be used if they become
widespread.
MASQUE Obfuscation implementations using HTTP/3 MUST support the fallback to
HTTP/2 to avoid incentivizing censors to block HTTP/3 or QUIC.
When the client wishes to use the "UDP Proxying" MASQUE application over
HTTP/2, the client opens a new stream with a CONNECT request to the
"masque-udp-proxy" protocol and then sends datagrams encapsulated inside the
stream with a two-byte length prefix in network byte order. The target IP and
port are sent as part of the URL query. Resetting that stream instructs the
server to release any associated resources.
When the client wishes to use the "IP Proxying" MASQUE application over
HTTP/2, the client opens a new stream with a CONNECT request to the
"masque-ip-proxy" protocol and then sends IP datagrams with a two byte length
prefix. The server can inspect the IP datagram to look for the destination
address in the IP header.
Security Considerations
Here be dragons. TODO: slay the dragons.
Traffic Analysis
While MASQUE Obfuscation ensures that proxied traffic appears similar to
regular HTTP traffic, it doesn't inherently defeat traffic analysis. However,
the fact that MASQUE leverages QUIC allows it to segment STREAM frames over
multiple packets and add PADDING frames to change the observable
characteristics of its encrypted traffic. The exact details of how to change
traffic patterns to defeat traffic analysis is considered an open research
question and is out of scope for this document.
When multiple MASQUE Obfuscation servers are available, a client can leverage
QUIC connection migration to seamlessly transition its end-to-end QUIC
connections by treating separate MASQUE Obfuscation servers as different paths.
This could afford an additional level of obfuscation in hopes of rendering
traffic analysis less effective.
Untrusted Servers
As with any proxy or VPN technology, MASQUE Obfuscation hides some of the
client's private information (such as who they are communicating with) from
their network provider by transferring that information to the MASQUE server.
It is paramount that clients only use MASQUE Obfuscation servers that they
trust, as a malicious actor could easily setup a MASQUE Obfuscation server and
advertise it as a privacy solution in hopes of attracting users to send it
their traffic.
IANA Considerations
We will need to register the "masque-udp-proxy" and "masque-ip-proxy" extended
HTTP CONNECT protocols.
References
Normative References
The MASQUE Protocol
This document describes MASQUE (Multiplexed Application Substrate over QUIC Encryption). MASQUE is a mechanism that allows co-locating and obfuscating networking applications behind an HTTPS web server. The currently prevalent use-case is to allow running a proxy or VPN server that is indistinguishable from an HTTPS server to any unauthenticated observer. We do not expect major providers and CDNs to deploy this behind their main TLS certificate, as they are not willing to take the risk of getting blocked, as shown when domain fronting was blocked. An expected use would be for individuals to enable this behind their personal websites via easy to configure open-source software. This document is a straw-man proposal. It does not contain enough details to implement the protocol, and is currently intended to spark discussions on the approach it is taking. Discussion of this work is encouraged to happen on the MASQUE IETF mailing list masque@ietf.org [1] or on the GitHub repository which contains the draft: https://github.com/DavidSchinazi/masque-drafts [2].
QUIC: A UDP-Based Multiplexed and Secure Transport
This document defines the core of the QUIC transport protocol. Accompanying documents describe QUIC's loss detection and congestion control and the use of TLS for key negotiation. Note to Readers Discussion of this draft takes place on the QUIC working group mailing list (quic@ietf.org), which is archived at <https://mailarchive.ietf.org/arch/search/?email_list=quic>. Working Group information can be found at <https://github.com/ quicwg>; source code and issues list for this draft can be found at <https://github.com/quicwg/base-drafts/labels/-transport>.
Hypertext Transfer Protocol Version 3 (HTTP/3)
The QUIC transport protocol has several features that are desirable in a transport for HTTP, such as stream multiplexing, per-stream flow control, and low-latency connection establishment. This document describes a mapping of HTTP semantics over QUIC. This document also identifies HTTP/2 features that are subsumed by QUIC, and describes how HTTP/2 extensions can be ported to HTTP/3.
Hypertext Transfer Protocol Version 2 (HTTP/2)
This specification describes an optimized expression of the semantics of the Hypertext Transfer Protocol (HTTP), referred to as HTTP version 2 (HTTP/2). HTTP/2 enables a more efficient use of network resources and a reduced perception of latency by introducing header field compression and allowing multiple concurrent exchanges on the same connection. It also introduces unsolicited push of representations from servers to clients.
This specification is an alternative to, but does not obsolete, the HTTP/1.1 message syntax. HTTP's existing semantics remain unchanged.
Key words for use in RFCs to Indicate Requirement Levels
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.
Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words
RFC 2119 specifies common key words that may be used in protocol specifications. This document aims to reduce the ambiguity by clarifying that only UPPERCASE usage of the key words have the defined special meanings.
The Transport Layer Security (TLS) Protocol Version 1.3
This document specifies version 1.3 of the Transport Layer Security (TLS) protocol. TLS allows client/server applications to communicate over the Internet in a way that is designed to prevent eavesdropping, tampering, and message forgery.
This document updates RFCs 5705 and 6066, and obsoletes RFCs 5077, 5246, and 6961. This document also specifies new requirements for TLS 1.2 implementations.
HTTP Transport Authentication
The most common existing authentication mechanisms for HTTP are sent with each HTTP request, and authenticate that request instead of the underlying HTTP connection, or transport. While these mechanisms work well for existing uses of HTTP, they are not suitable for emerging applications that multiplex non-HTTP traffic inside an HTTP connection. This document describes the HTTP Transport Authentication Framework, a method of authenticating not only an HTTP request, but also its underlying transport.
Using HTTP/2 as a Transport for Arbitrary Bytestreams
HTTP/2 provides multiplexing of HTTP requests over a single underlying transport connection. HTTP/2 Transport defines the use of the bidirectional extended CONNECT handshake to negotiate the use of application protocols using streams of an HTTP/2 connection as transport.
HTTP Alternative Services
This document specifies "Alternative Services" for HTTP, which allow an origin's resources to be authoritatively available at a separate network location, possibly accessed with a different protocol configuration.
Informative References
Service binding and parameter specification via the DNS (DNS SVCB and HTTPSSVC)
This document specifies the "SVCB" and "HTTPSSVC" DNS resource record types to facilitate the lookup of information needed to make connections for origin resources, such as for HTTPS URLs. SVCB records allow an origin to be served from multiple network locations, each with associated parameters (such as transport protocol configuration and keying material for encrypting TLS SNI). They also enable aliasing of apex domains, which is not possible with CNAME. The HTTPSSVC DNS RR is a variation of SVCB for HTTPS and HTTP origins. By providing more information to the client before it attempts to establish a connection, these records offer potential benefits to both performance and privacy. TO BE REMOVED: This proposal is inspired by and based on recent DNS usage proposals such as ALTSVC, ANAME, and ESNIKEYS (as well as long standing desires to have SRV or a functional equivalent implemented for HTTP). These proposals each provide an important function but are potentially incompatible with each other, such as when an origin is load-balanced across multiple hosting providers (multi-CDN). Furthermore, these each add potential cases for adding additional record lookups in-addition to AAAA/A lookups. This design attempts to provide a unified framework that encompasses the key functionality of these proposals, as well as providing some extensibility for addressing similar future challenges. TO BE REMOVED: The specific name for this RR type is an open topic for discussion. "SVCB" and "HTTPSSVC" are meant as placeholders as they are easy to replace. Other names might include "B", "SRV2", "SVCHTTPS", "HTTPS", and "ALTSVC".
Hybrid Encapsulation Layer for IP and UDP Messages (HELIUM)
HELIUM is a protocol that can be used to implement a UDP proxy, a VPN, or a hybrid of these. It is intended to run over a reliable, secure substrate transport. It can serve a variety of use cases, but its initial purpose is to enable HTTP proxies to forward non-TCP flows.
HTTP-initiated Network Tunnelling (HiNT)
The HTTP CONNECT method allows an HTTP client to initiate, via a proxy, a TCP-based tunnel to a single destination origin. This memo explores options for expanding HTTP-initiated Network Tunnelling (HiNT) to cater for diverse UDP and IP associations.
Bootstrapping WebSockets with HTTP/2
This document defines a mechanism for running the WebSocket Protocol (RFC 6455) over a single stream of an HTTP/2 connection.
The Token Binding Protocol Version 1.0
This document specifies version 1.0 of the Token Binding protocol. The Token Binding protocol allows client/server applications to create long-lived, uniquely identifiable TLS bindings spanning multiple TLS sessions and connections. Applications are then enabled to cryptographically bind security tokens to the TLS layer, preventing token export and replay attacks. To protect privacy, the Token Binding identifiers are only conveyed over TLS and can be reset by the user at any time.
Post-Handshake Authentication in TLS
This document describes a mechanism for performing post-handshake certificate-based authentication in Transport Layer Security (TLS) versions 1.3 and later. This includes both spontaneous and solicited authentication of both client and server.
Secondary Certificate Authentication in HTTP/2
A use of TLS Exported Authenticators is described which enables HTTP/2 clients and servers to offer additional certificate-based credentials after the connection is established. The means by which these credentials are used with requests is defined.
Acknowledgments
This proposal was inspired directly or indirectly by prior work from many
people. In particular, this work is related to
and
. The mechanism used to
run the MASQUE protocol over HTTP/2 streams was inspired by .
Brendan Moran is to thank for the idea of leveraging connection migration
across MASQUE servers. The author would also like to thank
Nick Harper,
Christian Huitema,
Marcus Ihlar,
Eric Kinnear,
Mirja Kuehlewind,
Lucas Pardue,
Tommy Pauly,
Zaheduzzaman Sarker,
Ben Schwartz,
and
Christopher A. Wood
for their input.
The author would like to express immense gratitude to Christophe A., an
inspiration and true leader of VPNs.
Design Justifications
Using an exported key as a nonce allows us to prevent replay attacks (since it
depends on randomness from both endpoints of the TLS connection) without
requiring the server to send an explicit nonce before it has authenticated the
client. Adding an explicit nonce mechanism would expose the server as it would
need to send these nonces to clients that have not been authenticated yet.
The rationale for a separate MASQUE protocol stream is to allow
server-initiated messages. If we were to use HTTP semantics, we would only be
able to support the client-initiated request-response model. We could have used
WebSocket for this purpose but that would have added wire overhead and
dependencies without providing useful features.
There are many other ways to authenticate HTTP, however the authentication
used here needs to work in a single client-initiated message to meet the
requirement of not exposing the server.
The current proposal would also work with TLS 1.2, but in that case TLS false
start and renegotiation must be disabled, and the extended master secret and
renegotiation indication TLS extensions must be enabled.
If the server or client want to hide that HTTP/2 is used, the client can set
its ALPN to an older version of HTTP and then use the Upgrade header to
upgrade to HTTP/2 inside the TLS encryption.
The client authentication used here is similar to how Token
Binding operates, but it has very different goals. MASQUE does
not use token binding directly because using token binding requires sending
the token_binding TLS extension in the TLS ClientHello, and that would stick
out compared to a regular TLS connection.
TLS post-handshake authentication
is not used by this proposal because that requires sending the
"post_handshake_auth" extension in the TLS ClientHello, and that would stick
out from a regular HTTPS connection.
Client authentication could have benefited from Secondary Certificate
Authentication in HTTP/2 ,
however that has two downsides: it requires the server advertising that
it supports it in its SETTINGS, and it cannot be sent unprompted by the
client, so the server would have to request authentication.
Both of these would make the server stick out from regular HTTP/2 servers.
MASQUE proposes a new client authentication method (as opposed to reusing
something like HTTP basic authentication) because HTTP authentication methods
are conceptually per-request (they need to be repeated on each request)
whereas the new method is bound to the underlying connection (be it QUIC or
TLS). In particular, this allows sending QUIC DATAGRAM frames without
authenticating every frame individually. Additionally, HMAC and asymmetric
keying are preferred to sending a password for client authentication since
they have a tighter security bound. Going into the design rationale, HMACs
(and signatures) need some data to sign, and to avoid replay attacks that
should be a fresh nonce provided by the remote peer. Having the server
provide an explicit nonce would leak the existence of the server so we use
TLS keying material exporters as they provide us with a nonce that contains
entropy from the server without requiring explicit communication.