Re: [TLS] Possible blocking of Encrypted SNI extension in China

David Fifield <david@bamsoftware.com> Wed, 12 August 2020 16:11 UTC

Return-Path: <david@bamsoftware.com>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 143373A13A4 for <tls@ietfa.amsl.com>; Wed, 12 Aug 2020 09:11:43 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.099
X-Spam-Level:
X-Spam-Status: No, score=-2.099 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=bamsoftware.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OfPsRV_CDYYU for <tls@ietfa.amsl.com>; Wed, 12 Aug 2020 09:11:41 -0700 (PDT)
Received: from melchior.bamsoftware.com (melchior.bamsoftware.com [IPv6:2600:3c00:e000:128:de39:20ee:9704:752d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 153203A1385 for <tls@ietf.org>; Wed, 12 Aug 2020 09:11:40 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=bamsoftware.com; s=mail; h=In-Reply-To:Content-Type:MIME-Version:References :Message-ID:Subject:To:From:Date:Sender:Reply-To:Cc:Content-Transfer-Encoding :Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=JmyOXqC7MI5YvM1TOKXj9vyrz3YusoMwnoiMZ6MTHO8=; b=GtpVyT3Y1M9Hfp6QaBXQO6ZTw7 SzJ2oc+HNpEkWxuhw+LoJ1PkzW+JZ8Gnqoyh21mq09FEUK+j8vziYmWYieqK/x39pkp0mpY39+bfi H46gfgOVRezJIznzpXB37tmS45yYZOWuVStB7RD98t4hklvnak9P9SMtFI8C5M8fbA4g=;
Date: Wed, 12 Aug 2020 10:11:35 -0600
From: David Fifield <david@bamsoftware.com>
To: tls@ietf.org
Message-ID: <20200812161135.stztxyie7blioz3p@bamsoftware.com>
Mail-Followup-To: tls@ietf.org
References: <b32110f8-c9ba-e8db-f136-7cc60eba54e4@huitema.net> <1597123970590.77611@cs.auckland.ac.nz> <CAChr6SzzuyB7sxXJQ4gNJwa3iaQcC5jGPE3-sgfY_EkB7DoykA@mail.gmail.com> <1597125488037.97447@cs.auckland.ac.nz> <CAChr6SxLAJyweEDHL48-hT3X=d5E6jNrWZheOt+fSydpS=HhQw@mail.gmail.com> <c7e033d9-aa39-1293-2233-4ebb8d1502dc@huitema.net> <1597130085200.4129@cs.auckland.ac.nz> <CAChr6SypqD+J0LjJWxOQNQhXAvR7R4oLZQCKq_0PPbs+xjiSwg@mail.gmail.com> <20200811224203.qysncdptgiwfrvlu@bamsoftware.com> <1597215113998.32406@cs.auckland.ac.nz>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <1597215113998.32406@cs.auckland.ac.nz>
User-Agent: NeoMutt/20180716
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/9d4LWqWNgqB_d7kEGGsq-9ZhhxE>
Subject: Re: [TLS] Possible blocking of Encrypted SNI extension in China
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "This is the mailing list for the Transport Layer Security working group of the IETF." <tls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tls>, <mailto:tls-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/tls/>
List-Post: <mailto:tls@ietf.org>
List-Help: <mailto:tls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tls>, <mailto:tls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 12 Aug 2020 16:11:43 -0000

On Wed, Aug 12, 2020 at 06:51:48AM +0000, Peter Gutmann wrote:
> David Fifield <david@bamsoftware.com> writes:
> 
> >Peter is surely referring to the influential "The Parrot is Dead" paper from
> >2013
> 
> Yep, that was it, thanks (at least one person catalogues their reading by the
> looks of it :-).  Thanks for the ref to the followup, can't remember seeing
> that, but doesn't that just reinforce the Parrot paper?

Both papers are about detection, but I would not call one a
reinforcement of the other. Section 4 of "Seeing through
Network-Protocol Obfuscation", "Semantics-based attacks," finds problems
in the attacks proposed by "The Parrot is Dead". The authors design new
styles of attack (Section 5, "Entropy-based attacks", and Section 6,
"ML-based attacks") and apply them to deployed covert communications
systems. But of these systems, only one (FTE) is a "parrot" or mimicry
system (see the trichotomy of categories under "Network protocol
obfuscation" in Section 2). obfs3 and obfs4 are randomizing protocols,
not designed to resemble any particular cover protocol, and meek uses
exactly the tunnelling approach advocated in "The Parrot is Dead,"
sending its requests via a headless Firefox for the sake of a proper TLS
fingerprint (Section 5.1 of https://censorbib.nymity.ch/#Fifield2015a).
The results do not really support the thesis that tunnelling is
essential or necessarily more resistant to blocking, though it remains a
good rule of thumb. Both tunnelling-based and non-tunnelling-based
systems are widely used today, with success in practice.

> The "Grounding Censorship Circumvention in Empiricism" paper is an important
> one too, you need to look at what the attackers are doing otherwise you'll end
> up throwing a ton of crypto at something that makes no difference.  In
> particular in reference to a question someone else asked about ECH and TLS
> 1.3, since it's not defending against anything the censors are doing I can't
> see what its presence or absence would do.  Something like ECH seems like
> classic inside-out design, "here is our cool piece of crypto trickery, and
> whatever it happens to defend against is the threat".

Rob is correct. Blocking on the basis of plaintext SNI is common and
extensively empirically documented. It would be unusual, these days, for
a firewall to support DNS, IP address, and HTTP keyword blocking,
without also supporting SNI blocking. A few examples:
https://ooni.org/post/2020-tls-blocking-india/
	We recorded SNI-based blocking on both Bharti Airtel and
	Reliance Jio.
https://ooni.org/post/2020-iran-sni-blocking/
	To evaluate this methodology, we ran experiments in Iran because
	we know that Iran implements SNI based blocking.
https://censorbib.nymity.ch/#Chai2019a Section 4.2
	We detect that 21,446 sites are under SNI filtering in China.
	One interesting observation is that only 70 websites are
	exclusively censored by SNI filtering. In other words, SNI
	filtering is almost always used in a combination with other
	censorship techniques.
https://ooni.org/post/2019-egypt-blocks-bbc-and-alhurra/
	This is quite a strong indication of the presence of some form
	of Deep Packet Inspection (DPI) technology that is aware of TLS
	and which is most likely fingerprinting the SNI field of the TLS
	handshake.
https://censorbib.nymity.ch/#VanderSloot2018a Section 6.4
	Unfortunately, SNI places the domain name in clear-text in the
	first message sent by the client to the server, making it easy
	to detect when a client is connecting to a particular site from
	only the first message in a TLS handshake. We find that networks
	do interfere based on this first message alone.

But you don't have to take anyone's word for it, at least in the case of
the Great Firewall; this is another aspect that's easy to test from
outside. Start a packet capture on port 443 and send a ClientHello,
containing an SNI field known to be blocked, to a responsive HTTPS host
in China. You will immediately receive three RST packets, which are not
sent by the remote server but are injected by the firewall.

$ openssl s_client -connect www.tsinghua.edu.cn:443 -servername www.facebook.com

10:03:30.857872 IP localhost.60084 > www.tsinghua.edu.cn.https: Flags [S], seq 864764526, win 64240, options [mss 1460,sackOK,TS val 2739496015 ecr 0,nop,wscale 7], length 0
10:03:31.188496 IP www.tsinghua.edu.cn.https > localhost.60084: Flags [S.], seq 4063746934, ack 864764527, win 2105, options [mss 1460,nop,wscale 2,sackOK,TS val 202217658 ecr 2739496015], length 0
10:03:31.188555 IP localhost.60084 > www.tsinghua.edu.cn.https: Flags [.], ack 1, win 502, options [nop,nop,TS val 2739496346 ecr 202217658], length 0
10:03:31.189003 IP localhost.60084 > www.tsinghua.edu.cn.https: Flags [P.], seq 1:319, ack 1, win 502, options [nop,nop,TS val 2739496346 ecr 202217658], length 318
10:03:31.508859 IP www.tsinghua.edu.cn.https > localhost.60084: Flags [R.], seq 1, ack 319, win 995, length 0
10:03:31.508907 IP www.tsinghua.edu.cn.https > localhost.60084: Flags [R.], seq 1, ack 319, win 995, length 0
10:03:31.510050 IP www.tsinghua.edu.cn.https > localhost.60084: Flags [R.], seq 1, ack 319, win 995, length 0