Re: Don't require proof of waste! (was: Idea: DoS prevention by proof-of-work in Initial packet)

Christian Huitema <huitema@huitema.net> Fri, 02 September 2022 15:45 UTC

Return-Path: <huitema@huitema.net>
X-Original-To: quic@ietfa.amsl.com
Delivered-To: quic@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 40494C1522D1 for <quic@ietfa.amsl.com>; Fri, 2 Sep 2022 08:45:29 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.909
X-Spam-Level:
X-Spam-Status: No, score=-1.909 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_BLOCKED=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01] autolearn=unavailable autolearn_force=no
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4SiAv26V1GAQ for <quic@ietfa.amsl.com>; Fri, 2 Sep 2022 08:45:28 -0700 (PDT)
Received: from mx43-out1.antispamcloud.com (mx43-out1.antispamcloud.com [138.201.61.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id AFEF6C1522C8 for <quic@ietf.org>; Fri, 2 Sep 2022 08:45:28 -0700 (PDT)
Received: from xse411.mail2web.com ([66.113.197.157] helo=xse.mail2web.com) by mx259.antispamcloud.com with esmtp (Exim 4.92) (envelope-from <huitema@huitema.net>) id 1oU8r2-0002XD-7S for quic@ietf.org; Fri, 02 Sep 2022 17:45:25 +0200
Received: from xsmtp22.mail2web.com (unknown [10.100.68.61]) by xse.mail2web.com (Postfix) with ESMTPS id 4MK2Kv61QFzBXf for <quic@ietf.org>; Fri, 2 Sep 2022 08:45:07 -0700 (PDT)
Received: from [10.5.2.14] (helo=xmail04.myhosting.com) by xsmtp22.mail2web.com with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from <huitema@huitema.net>) id 1oU8qx-0001A4-Ks for quic@ietf.org; Fri, 02 Sep 2022 08:45:07 -0700
Received: (qmail 29562 invoked from network); 2 Sep 2022 15:45:05 -0000
Received: from unknown (HELO [192.168.1.106]) (Authenticated-user:_huitema@huitema.net@[172.58.43.110]) (envelope-sender <huitema@huitema.net>) by xmail04.myhosting.com (qmail-ldap-1.03) with ESMTPA for <libor.peltan=40nic.cz@dmarc.ietf.org>; 2 Sep 2022 15:45:05 -0000
Message-ID: <0dbfab94-6941-24ce-8ce4-edadafd11523@huitema.net>
Date: Fri, 02 Sep 2022 08:45:04 -0700
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0
Content-Language: en-US
To: "libor.peltan" <libor.peltan=40nic.cz@dmarc.ietf.org>, quic@ietf.org
References: <1e3a443d-abcd-6cd4-7abd-5fa0c598baa9@nic.cz>
From: Christian Huitema <huitema@huitema.net>
Subject: Re: Don't require proof of waste! (was: Idea: DoS prevention by proof-of-work in Initial packet)
In-Reply-To: <1e3a443d-abcd-6cd4-7abd-5fa0c598baa9@nic.cz>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: 8bit
X-Originating-IP: 66.113.197.157
X-Spampanel-Domain: xsmtpout.mail2web.com
X-Spampanel-Username: 66.113.197.0/24
Authentication-Results: antispamcloud.com; auth=pass smtp.auth=66.113.197.0/24@xsmtpout.mail2web.com
X-Spampanel-Outgoing-Class: unsure
X-Spampanel-Outgoing-Evidence: Combined (0.13)
X-Recommended-Action: accept
X-Filter-ID: Pt3MvcO5N4iKaDQ5O6lkdGlMVN6RH8bjRMzItlySaT9HUMNF2vA5wM18MhndOCOGPUtbdvnXkggZ 3YnVId/Y5jcf0yeVQAvfjHznO7+bT5x6h2yQpzTslcOqazQkKtAFKj/EwzSHE5FGYwwjsNRPCGrR O7hzMpc/ppFv81/umy7mD6wdmZPcItWbGe10hXJtXL4FsauCVkDjmcYJdU3yWp7KuHNaaKdg7iBE ZefdsNUFWKwa/wzJUjmazeC7ImcahbMIblA5cvdmE+v6D1FYXBQ6V51u76v35b1wNe/MvdLK0iWX QXXTLFLETKH72XTe2+J9PgaoF8SQHto3le4zsHTaeQtlKubP6iUTjj6yPARK6buALVaA782LKxg6 vRmng8N1aLhXqdc+jC1RcnVud53D5caUhbVtvqItBqoizkEt9O20UjkwI0v+LOlw05G4BS+iyyNq bT8dUMXMJ4tUCMj6G37ZfAMLceP5aNHPt26RBupu5v1nytoNnc138GfEJRQ2qC7jjynPIHPNqSn4 QTXUjLjYWQt1/5xnQymMoPsgr/U0flMcy2Vi/IcBgY4arPaiJ1W6hAyiRC61jekdwIcXNugoOEbH RyFULpSjm7hMIABpqqRGKyDs8xujM3cqBeOl1vvorVlRuGVSovFiMd/49+SjdX9Aepl0C1QLLrky iNyRLfW8EFHDsBAewtbTEnFzsC48bTEFY06/YbB87Ww8G0LoS8V3Mt1pta8qAcLtCB3G1CwpaI3Z 4ESkMWDVJEenxBoIht3V0nekAoxXAhoWLAfuRhcAqR76ySJtPDmyuLfHqAnAj7rgKH7+eCmmT8h7 +driMWZDlb/DKhDwIFShcA6Xvva2QAVEjpqzANbJ1UfXmet2cbFKoyT/OdZLqaKj1r3ckQp3FMI8 Dfv40G0AuXq0T17woJo3avKeADIsy647Mn0zwmGzAi3Zn+YdthRNgs7Ig4l/XErpYn3glZTKFuaT l19W3ISq9+1KiLsESGU+y+fjdgjudZxiTPi+MG1QP35nsYfP84c+RFK3KiZuZ5OAUoGBziSYFLZu u6zX3xxsmqT8l9ARlsTalAaf
X-Report-Abuse-To: spam@quarantine11.antispamcloud.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/zHyP9YoRx-JBkiMTrgD4lnDI1og>
X-BeenThere: quic@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: Main mailing list of the IETF QUIC working group <quic.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/quic>, <mailto:quic-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/quic/>
List-Post: <mailto:quic@ietf.org>
List-Help: <mailto:quic-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/quic>, <mailto:quic-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 02 Sep 2022 15:45:29 -0000

On 9/1/2022 11:59 PM, libor.peltan wrote:
> Hi all,
>
> I'm developing DNS-over-QUIC implementation in authoritative Knot DNS. 
> I'm highly concerned about DoS resistance. According to our findings 
> so far, the situation around authoritative DNS-over-QUIC (ADoQ) is 
> following:
>
>  - The server can try to defend by requiring Retry packet, which 
> prevents source address spoofing and too simple Initial packet floods, 
> but also cripples legitimate connections by an additional RTT for the 
> whole duration of attack (possibly all the time).

You can mitigate the impact on legitimate connections by having the 
server provide "NEW TOKEN" frames to the clients that have been 
validated. The clients can then use the tokens in the next connection to 
directly validate their IP address.

>
>  - A determined attacker can simply proceed with complete connections, 
> including Retry packets. We have developed even the tools to perform 
> such attacks.

Yes. This is a general attack against TLS. The initial handshake 
includes extensive public key operation. Attackers can force the server 
to create lots of new connections, each time requiring the public key 
operations.

Note that this is mostly a connection setup issue. The public key 
operations require lots of CPU during the handshake, but once that is 
done, the cost of AEAD encryption of the QUIC packets is a small part of 
the overall total -- typically much less than the cost of the UDP socket 
operations.

>  - Opposed to plain DNS, the bottleneck is no longer any connection 
> bandwidth. When both sides encrypt and decrypt all the packets, what 
> matters is the CPU power.
>
>  - QUIC protocol seems to be balanced in the way that it gives no 
> advantage to client or server side. If (and only if) the attacker has 
> more CPU power available, it's able to exhaust the server computing 
> resources, leading to DoS.

Servers can mitigate the issue somewhat by using hardware acceleration, 
e.g., a specialized cryptographic engine.

>
> I must admit I'm a "DNS guy" and I might have imperfect insight in 
> QUIC nuances. Is there any tactic that would help defend the server 
> against DoS? I always think that HTTP-over-QUIC servers must face the 
> same issues. But it's also possible that they just rely on CDNs and 
> stuff, which is not really appliable on common authoritative DNS.

Your initial subject line mentioned grafting some kind of "proof of 
waste" (aka proof of work) in the initial exchange, to force the clients 
to slow down. We have seen proposals like that for a long time, starting 
with the idea of adding proof-of-waste token to e-mail as a way to fight 
spam. This does not work. DDOS attackers typically use someone else 
servers, and don't mind wasting energy and raising electric bills on the 
bots. Also, consider that the DoQ client sometime run on mobile devices, 
and that wasting energy there is not practical. Plus, generally, 
protocols that deliberately waste energy are bad for the planet, and 
should be avoided.

>
> I looked also at Retry packet offload, but this does not make much 
> sense for ADoQ.

You should try using the combination of Retry and NEW TOKEN.


>
> Thank you for any replies, suggestions and ideas!


There is no good "local" solution to DDOS. Once your servers are 
attacked by a large enough botnet, all bets are off. Indeed, attacks 
using UDP would work too. The only defenses that work involve getting 
help from a big CDN or similar. Or building very large server 
configurations, like the DNS root.

-- Christian Huitema