From owner-freebsd-net@freebsd.org Sun Feb 21 18:10:35 2021 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5938D55D5C8 for ; Sun, 21 Feb 2021 18:10:35 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 4DkCzH22xxz3F0v for ; Sun, 21 Feb 2021 18:10:35 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by mailman.nyi.freebsd.org (Postfix) id 4626655D69F; Sun, 21 Feb 2021 18:10:35 +0000 (UTC) Delivered-To: net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 45F0C55D4C1 for ; Sun, 21 Feb 2021 18:10:35 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DkCzH1cXFz3Drd; Sun, 21 Feb 2021 18:10:35 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.codepro.be", Issuer "R3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id 103ADAA9D; Sun, 21 Feb 2021 18:10:35 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: by venus.codepro.be (Postfix, authenticated sender kp) id 9811D8A27; Sun, 21 Feb 2021 19:10:33 +0100 (CET) From: "Kristof Provost" To: "Doug Hardie" Cc: "net@freebsd.org" Subject: Re: IPv6 Fragmentation Date: Sun, 21 Feb 2021 19:10:32 +0100 X-Mailer: MailMate (1.13.2r5673) Message-ID: In-Reply-To: <5F0CE151-3B44-4692-AE82-F292B99BAC29@sermon-archive.info> References: <472A2B49-9BEC-4335-B6FB-AC4DAA0F0310@lurchi.franken.de> <5F0CE151-3B44-4692-AE82-F292B99BAC29@sermon-archive.info> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Feb 2021 18:10:35 -0000 On 21 Feb 2021, at 0:02, Doug Hardie wrote: >> On 20 February 2021, at 04:13, Kristof Provost >> wrote: >> >> If you don’t have scrub fragment reassemble set then you have to >> include something like pass log inet6 proto ipv6-frag all to pass >> fragmented packets (assuming you block by default). >> >> You really, really want scrub fragment reassemble because otherwise >> your firewall can be trivially bypassed, but you need one of the two >> for fragmented packets to work. >> > > I went with reassembly as it was easy to configure. However, is there > some place where the trivial bypassing is addressed in detail? I > would like to understand that. > Essentially this: https://en.wikipedia.org/wiki/IP_fragmentation_attack#Fragmentation_for_evasion The attacker breaks up the packet into fragments so that the real upper layer header (e.g. TCP) is not in the first packet. All the firewall sees is a fragmentation header and a few random bytes. Not enough to, for example, get the port number. So the firewall allows it through (‘pass log inet6 proto ipv6-frag’), and your policy to deny traffic to port 22 has not been applied. Best regards, Kristof