[Masque] TTL and infinite QUIC-proxy loops

Martin Duke <martin.h.duke@gmail.com> Wed, 15 November 2023 16:54 UTC

Return-Path: <martin.h.duke@gmail.com>
X-Original-To: masque@ietfa.amsl.com
Delivered-To: masque@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C5CB2C14CF18 for <masque@ietfa.amsl.com>; Wed, 15 Nov 2023 08:54:26 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.107
X-Spam-Level:
X-Spam-Status: No, score=-2.107 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, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
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 U5umAWvhoKWr for <masque@ietfa.amsl.com>; Wed, 15 Nov 2023 08:54:26 -0800 (PST)
Received: from mail-vk1-xa2f.google.com (mail-vk1-xa2f.google.com [IPv6:2607:f8b0:4864:20::a2f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 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 58D5AC14CE2B for <masque@ietf.org>; Wed, 15 Nov 2023 08:54:26 -0800 (PST)
Received: by mail-vk1-xa2f.google.com with SMTP id 71dfb90a1353d-4ac05ca3935so3135416e0c.1 for <masque@ietf.org>; Wed, 15 Nov 2023 08:54:26 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700067264; x=1700672064; darn=ietf.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=zRtzpDP9UdandXT2s8wm7zdpVx+JGtn1wnuSFGhtLfg=; b=U1Fxppm2cEh8Dmmd4zW7pJmd4BLM48dFO29xYEX555QD7J/RTO+i3ejFEoa82wzLe1 /tLL1/5n48Y/qDoUh/b8GWg229B7bp/m4q9URHF08XC8O3qi/icU8MvHy2rgtnHhjwyJ C3xk4Z2ahZtyf/KcOwEhttmvP2o06Jj8zgRDGML+7SExryXfQDohi4TdUkk89l/WCC6l cGa+PBKt5RBh3GcPP8lSQT0pZPHIoQ5kOkeDfetUTdf0ri0c7GMmKXIcGKmMS04bVmrs SK9IJ4aYMGKeOf+F3qZaa3prxBYTadYZH5Syu65lMTNZYdwwGU5TY+/Ft9qPVmnJRfq0 xdgw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700067264; x=1700672064; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=zRtzpDP9UdandXT2s8wm7zdpVx+JGtn1wnuSFGhtLfg=; b=ITQd/Nijj7qgO2BUs/MwNi6LySciFsgE3hXiBTyaKpfPazC1JVWB9Ee5eqyjkU3hTD 0ga0LK52YP6ww5HxwkVGH/VsFuuq5lN+XYQ5k37rrk+4MfGTvOXOxhorCP0VRXAHzEXU RDfNkh5vr7D7MAyVNYqmZ2xc3fe3BZGTS8OoZZ6uukgpR3fQvadvWtSw+ydYFciEp1eT OYUvZcgEHDxJ+4TGv+yn/PdZ5VQuvmOaqmQOCM8/bvNvd/ay0bVV4TxsTbne1sh0vwIE cBO4j0DcA7OgtNOwary7QSor5zARZPjxYsYH0nktXGZWWF8FqYRF6lh732iLVGlntWMX EOqg==
X-Gm-Message-State: AOJu0YwpCJx/P+efkvwgotx8KUK445IfqBNPMhSVncYO0a5dVa8jE/1S oxqgDeUBXxu46oPM+5xqfD7/g9Px8fRJYQS3jh6wfqh8
X-Google-Smtp-Source: AGHT+IEYOJHfoP7M96KIzsM6U/j90Pgc3+0CSASQ4L1d4g/oexQNhQYMKtvzWDaW84w2rsWsHZXTdxbCsGuXMsm3L9Y=
X-Received: by 2002:ac5:c916:0:b0:4ab:f40f:c50 with SMTP id t22-20020ac5c916000000b004abf40f0c50mr12480307vkl.10.1700067264495; Wed, 15 Nov 2023 08:54:24 -0800 (PST)
MIME-Version: 1.0
From: Martin Duke <martin.h.duke@gmail.com>
Date: Wed, 15 Nov 2023 08:54:11 -0800
Message-ID: <CAM4esxRt5nua=ftxaDn4N_L3jQigJpkOH6LCqDrK1h1qwhVHwA@mail.gmail.com>
To: MASQUE <masque@ietf.org>, Ted Hardie <ted.ietf@gmail.com>
Content-Type: multipart/alternative; boundary="000000000000650628060a33c13b"
Archived-At: <https://mailarchive.ietf.org/arch/msg/masque/DTocAxx9IWSePAwjRi7hIA3UwpY>
Subject: [Masque] TTL and infinite QUIC-proxy loops
X-BeenThere: masque@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: Multiplexed Application Substrate over QUIC Encryption <masque.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/masque>, <mailto:masque-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/masque/>
List-Post: <mailto:masque@ietf.org>
List-Help: <mailto:masque-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/masque>, <mailto:masque-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 15 Nov 2023 16:54:26 -0000

(Looking forward to not having to say "with no hats" in 4 months).

In my presentation in Prague on infinite quic-proxy loops, I dismissed the
idea that simply decrementing the TTL was a sufficient mitigation for
infinite loops caused by a misbehaving client, because 256 hops is still a
lot. In response, Ted suggested that we could use a lower limit.

Thankfully, we did not try to further design this at the mic.

But, thinking about it some more, Ted's suggestion could mean two things:

(1) Use the IP TTL field: "When receiving a packet from the target, a proxy
MUST set the TTL on the forwarded packet's IP header to a value lower than
the TTL value of the incoming IP header. Furthermore, the TTL value MUST be
no larger than N".

Clearly, for some value of N the mitigation would be sufficient. I have not
checked if this in some way violates the rules about IP TTL. I also wonder
if a hard limit is sufficiently permissive for legitimate but long paths.

(2) There is some sort of MASQUE field that counts down the number of proxy
hops. I cannot see how this can work, as (a) these are packets from the
target, which is not going to add MASQUE-specific stuff; (b) by design,
proxies do not know if targets are also MASQUE proxies; and (c) by design,
proxies to do not know if clients are MASQUE proxies.

*****

I do not object to decrementing the IP TTL field by one in forwarded mode,
though I think that is an insufficient mitigation for this attack. If
anyone has a better-thought out design to enforce a limit, or thinks that
256 hops is just fine, I would appreciate their input.

Martin