Re: Idea: DoS prevention by proof-of-work in Initial packet

Willy Tarreau <w@1wt.eu> Sat, 03 September 2022 04:59 UTC

Return-Path: <w@1wt.eu>
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 8BC60C14CF1E for <quic@ietfa.amsl.com>; Fri, 2 Sep 2022 21:59:52 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.911
X-Spam-Level:
X-Spam-Status: No, score=-6.911 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, 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 b9IoCQ8wNH43 for <quic@ietfa.amsl.com>; Fri, 2 Sep 2022 21:59:50 -0700 (PDT)
Received: from 1wt.eu (wtarreau.pck.nerim.net [62.212.114.60]) by ietfa.amsl.com (Postfix) with ESMTP id 5BE62C1522B3 for <quic@ietf.org>; Fri, 2 Sep 2022 21:59:50 -0700 (PDT)
Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 2834xi9I009157; Sat, 3 Sep 2022 06:59:44 +0200
Date: Sat, 03 Sep 2022 06:59:44 +0200
From: Willy Tarreau <w@1wt.eu>
To: Martin Duke <martin.h.duke@gmail.com>
Cc: "libor.peltan" <libor.peltan=40nic.cz@dmarc.ietf.org>, IETF QUIC WG <quic@ietf.org>
Subject: Re: Idea: DoS prevention by proof-of-work in Initial packet
Message-ID: <20220903045944.GA9116@1wt.eu>
References: <1e3a443d-abcd-6cd4-7abd-5fa0c598baa9@nic.cz> <CAM4esxSujmkTFCtPWcxK0SYhgvtQqWHN2TWiiLEvdcu4pjcA7Q@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <CAM4esxSujmkTFCtPWcxK0SYhgvtQqWHN2TWiiLEvdcu4pjcA7Q@mail.gmail.com>
User-Agent: Mutt/1.10.1 (2018-07-13)
Archived-At: <https://mailarchive.ietf.org/arch/msg/quic/GaYHjQFQWbO6w6oBfkGl5IOcn3Q>
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: Sat, 03 Sep 2022 04:59:52 -0000

On Fri, Sep 02, 2022 at 02:42:54PM -0700, Martin Duke wrote:
> Hi Libor,
> 
> Your subject line hints at a proposal, but I can't parse one in your email.
> 
> Regardless, yes, protocol anti-DoS mechanisms rely on the server having as
> much capacity as the client. If this is not the case, the attacker
> can always overwhelm the server by simply completing legitimate
> transactions at scale.

Agreed!

> The Retry token is the proof-of-work you're hinting at. If you don't want
> the latency associated with that, I
> encourage you to implement a more selective rule on when you send Retry
> (e.g. only when the server is under high load, or from specific IP
> addresses).

FWIW that's what we're doing in haproxy. We mimmick what's usually done
in TCP stacks with SYN cookies, and start sending Retry when the number
of half-open connections is higher than a configurable threshold. I don't
see a need for slowing down regular clients for a false impression that
it would allow to stop DDoSes; when you have one million machines in front
of you, the proof of work becomes of limited use and all clients suffer.

Willy