Re: [v6ops] Security issues in RFC8754 and related/subsequent drafts?

Andrew Alston <Andrew.Alston@liquidtelecom.com> Mon, 25 October 2021 08:16 UTC

Return-Path: <andrew.alston@liquidtelecom.com>
X-Original-To: v6ops@ietfa.amsl.com
Delivered-To: v6ops@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 41AB53A09D8 for <v6ops@ietfa.amsl.com>; Mon, 25 Oct 2021 01:16:56 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.118
X-Spam-Level:
X-Spam-Status: No, score=-2.118 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, HTML_MESSAGE=0.001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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=liquidtelecom.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 xf_h1h1QBOj1 for <v6ops@ietfa.amsl.com>; Mon, 25 Oct 2021 01:16:51 -0700 (PDT)
Received: from eu-smtp-delivery-182.mimecast.com (eu-smtp-delivery-182.mimecast.com [185.58.85.182]) (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 BD49C3A0945 for <v6ops@ietf.org>; Mon, 25 Oct 2021 01:16:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=liquidtelecom.com; s=mimecast20210406; t=1635149807; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=lJ0CYZLCLdRsosqZUxNE+XangfoPAKPdgl5trvqNj3U=; b=Xkgke49MiY8iFdGxPgkGXCJ7k28eP1RjRUu856YkknE3cMOSAfPHyW6EDC/WNvorRUKeWb Daow9igZ30fkxzi0oFEEYb4govjDb6kzSRwLABWxxiCkEEAKlWLm7YArFanVsMjgpsiN3g w0bp5TjBLDp93nfBxNcFtNc6P4h5OTo=
Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04lp2050.outbound.protection.outlook.com [104.47.13.50]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-198-I94lujXUNSaO5ORkGQFv1A-1; Mon, 25 Oct 2021 09:16:46 +0100
X-MC-Unique: I94lujXUNSaO5ORkGQFv1A-1
Received: from AS8PR03MB7622.eurprd03.prod.outlook.com (2603:10a6:20b:346::6) by AS8PR03MB7669.eurprd03.prod.outlook.com (2603:10a6:20b:34f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.16; Mon, 25 Oct 2021 08:16:44 +0000
Received: from AS8PR03MB7622.eurprd03.prod.outlook.com ([fe80::90ec:90d5:59c4:fef9]) by AS8PR03MB7622.eurprd03.prod.outlook.com ([fe80::90ec:90d5:59c4:fef9%6]) with mapi id 15.20.4628.020; Mon, 25 Oct 2021 08:16:43 +0000
From: Andrew Alston <Andrew.Alston@liquidtelecom.com>
To: "Eric Vyncke (evyncke)" <evyncke=40cisco.com@dmarc.ietf.org>, Andrew Alston <Andrew.Alston=40liquidtelecom.com@dmarc.ietf.org>, "v6ops@ietf.org" <v6ops@ietf.org>
Thread-Topic: [v6ops] Security issues in RFC8754 and related/subsequent drafts?
Thread-Index: AQHXyRlyE2pKHmh5b0+Yuk6vs+00KavjWjPQ
Date: Mon, 25 Oct 2021 08:16:43 +0000
Message-ID: <AS8PR03MB7622F21474B85C61E6AE9905EE839@AS8PR03MB7622.eurprd03.prod.outlook.com>
References: <9BF3A772-EFCD-403E-9089-15FDC941EC69@cisco.com>
In-Reply-To: <9BF3A772-EFCD-403E-9089-15FDC941EC69@cisco.com>
Accept-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: eec97e85-e7d8-4e1f-1914-08d9978fc7ef
x-ms-traffictypediagnostic: AS8PR03MB7669:
x-microsoft-antispam-prvs: <AS8PR03MB766944344EBF44C8E379F506EE839@AS8PR03MB7669.eurprd03.prod.outlook.com>
x-ms-oob-tlc-oobclassifiers: OLM:10000
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0
x-microsoft-antispam-message-info: zOZ68gYgNtyfOwngomXAuD2zSzgTtfLeZNuv/Gfd+qhMMLEHJdN1TPW1TMJralA3Iy70JlV2mvH5sPdAJs9Lwn+wVqOasN+J8Z6y3RT90MdeCeDV/uS/j8AytrFv23Fz3K6qMipKFhANaCkhX0jOg/hWLwKRQ5+izrb1sdPF15ABd5MIVsweNB/DEhDO7SQWqFut92KdYWbPvOBrlJU4f4FXiJHDAGmbhxIGmSRk6ykZfJVeyu1PbpWFY1PCVIdat9ghv0yadorl9FXGbpm7dc8IRl3/tkW0nlzra3ZSy+S2rNW/P0nVXrvELY0KIZaamXpcz7RAfjLIBQBELkMLR2LAkPHyaGeG6IXUfeqs6yK3+UFUuHI5r8b6OReuAkHsJp96tFIqDC8pvxda7adEO6ZKcl8joEJbxfd58k49ClhX0FfYNwTq5mMG246SVEhoSv/5IKXJtUnB1A8GGZKWEbWg6VGjNwCzjt9QvgKgCywRzG9/kRZK/uNa7VWwfOcRLGCP6SXcJhby/5fWMpRnMq0diMzsVgZa48O0b5ZlG5D24dbl4OYmHgbM2rx9nmf6+a+wAmT71JjxymFE5FbSDISJGgxLZpctigZ+1591oDhi1+2z/gWKYaqaRzo3q6gM+XI9m+cYa10oy943WSK0GN+DY5XEy3iAxGbzlM3O+UDbD+EowM62xTlkcH+YJ8A5/Qn6cCo6e+n5tmFiUuj3bw==
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR03MB7622.eurprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(122000001)(316002)(38100700002)(66574015)(6506007)(38070700005)(7696005)(2906002)(15650500001)(186003)(53546011)(83380400001)(9686003)(508600001)(66946007)(76116006)(55016002)(66476007)(66556008)(66446008)(64756008)(33656002)(8676002)(71200400001)(5660300002)(86362001)(52536014)(8936002)(110136005); DIR:OUT; SFP:1102
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: QqLnqpso1OKwUiyXGbokBBFVCBzjGIj3iFWU/487I80QK476anOOYqkfYRorvx0MqG6qNdd6MHEha3CKu5zxZbuIJTQX16OyidrWZz5HHrrWZjrhuEXUw78ZRej1VHLDXoHV0s2R0HSrCE5ReJmp9intS18wDEx+oUbdRjuYJ4WhTgi8Osa69QNB/93+0VLXvo8kp0TNMTN1gILHc92ogNyVaar3rqbpvVMYoOxl65eYkhk7aGpSSRq0TeXiToUZ4WSXf0y8MWwY8gVy330IseaBysC6/kFTmKIobFBo+ZJ9J0rlozH5an1FaaooByjAnTIhMnp0EojtYfztH7SplSff1vw85sNwmlmP5y9bqG4dl7hGARXmU5XJaMtx/1aBYamxQZaEIrEI2gepKQQ9k8C69/lt0Gvi1mhhzAK2NQe1rdZmJ6c++4u9UDaMAvbNUGBOP44S3ss7C5rcex+XsZJvorEPtb0zl0sUibE+JqDMx+iWNlm+TNMWPXCIet8hCc2JnpsUWmIBV5i8Z8YNcRlEOsLZQCrd2wzzXhclSwwC35Ou9DipxX0H7PJgsQYRLCV40pk0G6bYYbr3Mfj4xZ0OgsYxC05sLLfzBQaxubfv3xEESs4bDorM03pVu5lTv22YXXBW6efIg0WN2kZacogv0q1DDuqhEK8jiy8bGYCXxuGe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change-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: AS8PR03MB7622.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: eec97e85-e7d8-4e1f-1914-08d9978fc7ef
X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Oct 2021 08:16:43.3866 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 68792612-0f0e-46cb-b16a-fcb82fd80cb1
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: cbP1voHwPOU4Yr2XuxEl/kDKTlx1MWGQSvYIpKQzryomWvVTvA+8Zn4l0Wbw6lwdH0wiw+T9hGpWRung8mIKRxzq4nroqHaXZl+nIdEuMk8=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7669
Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=C82A168 smtp.mailfrom=andrew.alston@liquidtelecom.com
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: liquidtelecom.com
Content-Language: en-US
Content-Type: multipart/alternative; boundary="_000_AS8PR03MB7622F21474B85C61E6AE9905EE839AS8PR03MB7622eurp_"
Archived-At: <https://mailarchive.ietf.org/arch/msg/v6ops/4dCMq_KLpuBN5u4iMwbvaydz_iY>
Subject: Re: [v6ops] Security issues in RFC8754 and related/subsequent drafts?
X-BeenThere: v6ops@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: v6ops discussion list <v6ops.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/v6ops>, <mailto:v6ops-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/v6ops/>
List-Post: <mailto:v6ops@ietf.org>
List-Help: <mailto:v6ops-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/v6ops>, <mailto:v6ops-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 25 Oct 2021 08:16:56 -0000

See Inline


Thank you for correctly specifying that this concern applies generally to RFC 8547. I really appreciate your honesty.



I’m a little surprised that you would think I would do anything else – the problem is an srv6 problem – irrespective of tunneling mechanism – and there is absolutely no way to describe it outside of this.  I make an assumption here (correct me if I am wrong) that you are surprised based on my work on CRH – the reality is though – if the base (srv6) is as flawed as I believe it to be – and with the security holes I believe it to have, I would far rather see that work come to naught than for it to proceed while exposing the general internet.  If srv6 has to exist with all its flaws, then I still believe that the only way it will ever work is with a compression scheme, I just happen to believe that when srv6 is this flawed, it has to be fixed before we start stacking things on top of it – irrespective of it I have put effort into what we are stacking on top of it or not.



But, I fail to understand whether the issue is limited to SRH or is actually applicable to any tunnel ? As you described, in any encapsulation mechanism, BCP38 will be applied on the outer header in the ‘underlay’ and the encapsulated packet will indeed traverse any network until the endpoint [1]. Therefore, to handle the case when one endpoint of the tunnel is compromised, the other endpoint should apply BCP38 on the decapsulated traffic based on the other side of the tunnel.



How do you propose to apply BCP38 to the decapsulated traffic when once the SRH is dropped and the inner packet is exposed – it is sent to the fib – and the decapsulation point may be anywhere on the network and not at all the final destination of the traffic.  I.E the packet post decapsulation keeps moving on the network – what’s the checkpoint?



There are many well-known attacks (see RFC 6169 or section 2.7.2 of RFC 9099 for IPv6) on any tunnelling mechanism from sniffing to injection and others.



“There are other attacks” has never been an excuse to create something with more attack vectors – and never will be.  That’s the equivalent of saying – because there are other buffer overflows in software we should forget any form of bounds checking.



About the looping attacks, there is no amplification here as the compromised host needs to generate N packets to force the non-compromised tunnel endpoint to generate N (shorter) packets. The RFC 6324 describes a related attack by with amplification using ISATAP.



The looping attack doesn’t create amplification as such – it creates a loop.  The amplification happens when you adjust the inner packet pre-decapsulation to point to things that amplify it (think multicast addresses, broadcast addresses in the case of an inner v4 packet etc)



It is clear that tunnel endpoints (whether GRE, ISATAP, IPsec, or even SRH) should not trust blindly any packets and should only decapsulate valid packets (based at the minimum on source address and applying BCP38 and infrastructure ACL at their edge — if applicable). In the case of SRH[2] (or any RH actually even MIPv6 or RPL), this function should not be enabled by default and must be configured correctly.



Source verification in this particular case is entirely impractical – what you are proposing here is that every router carry an access list specifying every source host that can ever encapsulate an srv6 packet – and shoving the decapsulation of every packet through said LPM based access list – the performance hit trying to do that would be totally impractical and it simply wouldn’t work.



The specific case of C-SID without any SRH (except a pseudo one) does not change the above reasoning.



Finally, the traversed nodes are simply forwarding IPv6 packets (whether they are UDP, TCP, RH-0, SRH, ….) without specific processing: they are not impacted at all (and as you wrote they should apply BCP38 on the outer header for basic sanity checks for other reasons).



Or am I missing something ?



I think you’ve missed a fair bit 😊 See above.



Andrew




From: v6ops <v6ops-bounces@ietf.org<mailto:v6ops-bounces@ietf.org>> on behalf of Andrew Alston <Andrew.Alston=40liquidtelecom.com@dmarc.ietf.org<mailto:Andrew.Alston=40liquidtelecom.com@dmarc.ietf.org>>
Date: Thursday, 21 October 2021 at 19:09
To: "v6ops@ietf.org<mailto:v6ops@ietf.org>" <v6ops@ietf.org<mailto:v6ops@ietf.org>>
Subject: [v6ops] Security issues in RFC8754 and related/subsequent drafts?

Hi V6Ops,

I thought I would raise the issues that follow here – and perhaps we can look and if these issues are real – and if so – what the solutions are.

During a close review of the compression proposals for SRv6 (CRH/G-Srv6/USID etc etc) I noticed some potential very real vulnerabilities in SRv6 itself – which by extensions would affect srv6, srv6 network programming and all the compression flavors – including CRH on which I am a co-author.  Having raised these issues with my CRH co-authors it was agreed that I raise these issues here so we could discuss them.

So a little background – SRrv6 is typically considered as something that should run in the confines of a  “limited-domain” – the question I started with is – can we actually define and maintain the boundaries of a limited-domain – and if so – how.  The conclusion I came to was that the concept of limited-domain in regards to SRv6 was an extremely fuzzy thing.

Now to understand this – we need first to look at the typical methods of protecting things


  *   In the case of MPLS – we have what I will loosely refer to as a “fail-closed” scenario – that is to say – unless MPLS is enabled explicitly on an interface – ingress packets will not be processed – this works because of a separate ether-type
  *   In the case of SR-MPLS – an identical situation occurs
  *   In the case of dodgy IGP traffic – again, we have a fail-closed scenario
  *   In the case of standard IPv6 – we have the option of utilizing BCP38 and ingress filtering – and the same thing in regards to IPv4.

Now – lets examine SRv6 for a second.

In a scenario of Host A (A linux box) with address 2001:db8:1:1::10/64   utilizing a gateway of 2001:db8:1:1::fefe – packets from 2001:db8:1:1::10 flowing towards that gateway would pass ingress filter checks based on BCP38 since the source address was legitimate, unless we explicitly filtered out where that packet could be destined for based on its DA (More on this in a bit)

Now, lets imagine for a second that Host A gets compromised – and an attack encapsulates a packet that has an entirely different source address – and whatever random DA address inside an SRH.  That SRH has a SID list in it – be it via a direct SID or via compression mechanisms, and a DA towards the SID itself.  The packet then routes – passing the ingress checks – and landing up at the router with the first SID.  Since this was the only SID in the list – the packet outer SRH is removed – and the inner packet is forwarded to the FIB – and you just bypassed BCP38.

In a similar mechanism, if the SRH states that the next protocol header is an IPv4 packet – when the de-encapsulation happens at last SID – the payload (the inner v4 packet) will then be forwarded via the FIB – and off you go.

Now, normally to protect against this as stated – an access list would be placed on the networks borders to prevent encapsulated packets and packets containing SID destinations from entering the network.  However – if we consider the above scenario where the attack is coming from a compromised server inside the traditional borders – we have a problem.  The application of access lists to every port containing a server is also potentially unrealistic and unmaintainable (not to mention could potentially on certain devices overload the TCAMs)

We also have an even more potentially deadly issue – and this is entirely theoretical at this point since I haven’t had time to really investigate and test it with real code.  Let us presume in the above that the same host A is compromised.  It encapsulates a packet with an SRH – the internal packet is an Ipv4 packet – and its destined at a broadcast address of an IP subnet that is bound to the same network as the de-encapsulating router.  The source of the internal v4 packet is spoofed – we’ve now managed to – through a use of the tunneling mechanism, effectively created a version of an old tool called smurf – in a manner that is going to be pretty hard to trace.

Another potential scenario – would be for an attacker in host A to jit some ebpf code – that matches – modifies and re-encapsulates incoming return packets and retransmits then. Each time applying the same SRH.  The inner packet could be pretty much anything – so long as the internal DA is set back to host A that is sending the packet.  The packet would then flow out as an SRH encapsulated packet, the outer header would get popped, the inner packet would flow back towards the original compromised host, which would match it modify it re-encapsulate it and start the loop again.  Doing this with ebpf and a kernel jit – would be pretty difficult to spot if you didn’t know what you are doing because you wouldn’t potentially see any obvious userland code.

As a final thought – consider a hypervisor based system – that has multiple VM’s on it – and the filtering implications of all of the above – and the filtering becomes even more difficult to maintain and more complex.

Again – the filtering per every port that may contains a server or a desktop – that may not be realistic – especially when we could be running multiple ports that are handing out source addresses via RA – so – how do we solve this – or is this a major flaw in srv6 itself – that needs some other solution (give srv6 its own protocol code and acknowledge that it isn’t ipv6 at all, allowing for a “fail-closed” scenario maybe?)

As an operator that runs extensive IPv6 – I’d really like to hear thoughts and comments and potentially we can find a way to address these issues.

Thanks

Andrew