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

Andrew Alston <Andrew.Alston@liquidtelecom.com> Thu, 21 October 2021 17:08 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 61BB23A083F for <v6ops@ietfa.amsl.com>; Thu, 21 Oct 2021 10:08:34 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.096
X-Spam-Level:
X-Spam-Status: No, score=-2.096 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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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 y2GG5aVcwEeq for <v6ops@ietfa.amsl.com>; Thu, 21 Oct 2021 10:08:07 -0700 (PDT)
Received: from eu-smtp-delivery-182.mimecast.com (eu-smtp-delivery-182.mimecast.com [185.58.86.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 726103A082C for <v6ops@ietf.org>; Thu, 21 Oct 2021 10:08:07 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=liquidtelecom.com; s=mimecast20210406; t=1634836084; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=94jvVa7B4hMjJHj0qOBQUF70UzamBI9E1m1wXOEkKQ8=; b=HwLQhu3mozWrzIcPGIUz8VSYAnLw2DpkFYBr5QBLkzLIKIxcR1/vidkbBMk0IFYIsXzHxs TCCpEhfoT2QYKjVjas1Gc7Cm5fcCTwyz3xuti+DUU08acl3vVNXez1QlqVleuZXRo/0798 qVUBLunlTeZb9mdY1NnKq+pT/DS2Lnw=
Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04lp2050.outbound.protection.outlook.com [104.47.12.50]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-225-Nmw7DXpgPIOeC4uPe_sKHg-1; Thu, 21 Oct 2021 18:08:02 +0100
X-MC-Unique: Nmw7DXpgPIOeC4uPe_sKHg-1
Received: from AS8PR03MB7622.eurprd03.prod.outlook.com (2603:10a6:20b:346::6) by AS8PR03MB7797.eurprd03.prod.outlook.com (2603:10a6:20b:348::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.18; Thu, 21 Oct 2021 17:08:01 +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.018; Thu, 21 Oct 2021 17:08:00 +0000
From: Andrew Alston <Andrew.Alston@liquidtelecom.com>
To: "v6ops@ietf.org" <v6ops@ietf.org>
Thread-Topic: Security issues in RFC8754 and related/subsequent drafts?
Thread-Index: AQHXxp4zP+qugBEUYEKpNlrZT9uUPg==
Date: Thu, 21 Oct 2021 17:08:00 +0000
Message-ID: <CB45220A-ECE6-492A-8A37-D189A71CDA2B@liquidtelecom.com>
Accept-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
user-agent: Microsoft-MacOutlook/16.53.21091200
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: c656cce3-3a55-4f06-28b6-08d994b55660
x-ms-traffictypediagnostic: AS8PR03MB7797:
x-microsoft-antispam-prvs: <AS8PR03MB779753D9815331174A7CB37EEEBF9@AS8PR03MB7797.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: G/heAfcyr1rfiNrYAMvhxHfysXddwZd30Ti2kSGFgSa35cMHgm3KfyGs6/zbyTxMFD2cuQ6tGqSQDd2ZJIGDwDyzi35nfndCvBY7aXdLDGvxQd2un7JHKi0A/I5k9UAQfGu8Wgjlf8Wa8iP61P9L2VwD7NIaFmn6+LRbh08ALpa9pBhawZP2D5yroS58NFoz/Q0lBd8VFNLRyhGBn7YM+WmXWWZQICiGjXLgy7W6KZgNpIYVsloUTMK6OJm8U1AeHSPyd+RbTmeHrHSiQhBWwhc1xzykwXHmNkkTIOvpUd1ZuS/gPMG7Lm69Jg1WQfmIyEro78Ld0SpJYSmRz9KjxIN8zk5mQpe5mZFPtqL1+QCKlFbVrWfb+2jF5sFDWNc2EMR54aQNuHIcoTL5anCkKTbsk32QbtDtCuTTdVBuw1R4/6oecM1bYovbwSX6ahYOUxEiAKWHKgfWZLZjpTc5ewLcv8igYzraPwqEQ/NDOS0mo5R8rczoskP1E7PFYyysadzTionlmFELfrpCaDDDirNzQAHFNHrSqxcp77Mked8nTaGpkVODsiEWrjLKQ7YbwrEnL2HNa/pqHPgOheuyRRqmedZBLxbZc/vatdZm3dsX3Rwuvj/o9d1lGRcpPZ/XkijDGk7Masw42ZyvQoQP0/ZrpQ+7Ce/HZO3jTWF7lX7ptuBt4nQrwHXgZdJ8HsV37ffKxT89VAB5iWHFD10UGgdpB5Mn30jMnLa0o0oEjRBz0LVqZhq+DJbC3MafoVJz
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)(83380400001)(86362001)(122000001)(66556008)(66574015)(36756003)(66446008)(5660300002)(186003)(2906002)(33656002)(6512007)(6506007)(15650500001)(64756008)(38100700002)(71200400001)(8676002)(508600001)(76116006)(91956017)(38070700005)(8936002)(2616005)(316002)(6486002)(66476007)(66946007)(6916009)(45980500001); DIR:OUT; SFP:1102
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: =?utf-8?B?SjRZUkljOGVjdDBFQUFEdlhDQ0RhczQvNC9BZC9xNmxWVHhIN0d3dndUaUhu?= =?utf-8?B?NFNNdjJKYmJRTklLVlE2UmVEa1Y5Sk9TTVFsZmpmR3lVMWZPWmZ2YVFrZ2U5?= =?utf-8?B?VUNMcWhUWlFpOVVXeVNsRWlLNk9zMHYwaEh1dnVKdUFnVUdGVkVFY2xvVEVQ?= =?utf-8?B?U21kd2VKeEpBSVdTNFd1WFpKRytYbGZORjBleHNXRWpBMVRMQmN6TVo0dlFx?= =?utf-8?B?OUF2dEZwOUl0UVdIVmNhaUdrcms3NU82Qy8zdkxiL25XR0dqZDFaMWpHalZo?= =?utf-8?B?enJqM1FKOE1QY1hjNDlLUWtyZHA5US94ZC9ybEdKUk5XL2RqZThhNWI1d0pt?= =?utf-8?B?ZWIrY0JEZjJlU0xCVTBRY2lSVlFUUlRxbGNYWERRZnlGOEdxWXV3bm4rNTdP?= =?utf-8?B?K2JFOTA2T1VPQkVKc0tjRGd1ZzMrSFB0dkxtOHY3RCs2QUFKSExWT1psYVVB?= =?utf-8?B?WDhsTXNMZGc3VmNjcGtZNXNHSUEwUjl4UHJ3aEY2Z1REclI2aWl4NlhWZE5l?= =?utf-8?B?UDFvUzk2N0Q3T1lDL28ycUUxSEZIOEFOMndSK1NlUTN4VVZJR1hiMlRmVmt5?= =?utf-8?B?UEc1NXlmcWRlN3lWaktMV2h3dm9kOFMxS2dLRjNXOExMNmtqejFacFRHL3p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1FIaHg5SVh6ZG41VEZJbXFM?= =?utf-8?B?aXhYR01ra1N2OEZ5RFR0QS92K2FFWlpGaXVBand4SmFyT3ZQbnFTaGhyNVJQ?= =?utf-8?B?ZHhvZ1ZhVGNlMnZCaXBPbmR1bFJTcTdnMW1JdlVYb1RvMXBSV05ubjd1dytn?= =?utf-8?B?ay9pYkcrTkE4aXNxK2JlSTVGd0tpendmZkpFYW4xd1htQmdQZVJlV1dxTFJo?= =?utf-8?B?RkJiUzA4QjBhblkxMldWTzNQdXZ2bU1RUFdQeVJQUmZQRHlKZk9Fd0FVcVZ5?= =?utf-8?B?MjFJcjNob2REQ3crQzJ1Z1pxN2RxQjZPTUZ2RHB5ZDRCYURZaWJVK2R6NU92?= =?utf-8?B?SSs0UTEzT2haRGl4ZkxpWFMvUlcvRCsvVGk4Y0huVGUweXhIWXY2TG5NcEkx?= =?utf-8?B?SGRoVi93RWFRTjNKRCsyWVpBT2lyQUJ0ajVnUDVNWXlsRHV2VU91T1ZEMUNW?= =?utf-8?B?Y2VJdDdQb2lqbUdVaVFlTWpLOFllT3UrRnk2TnJaV2w3cDc1Q3VuQ3BnZUdm?= =?utf-8?B?ZG1TYXdPdm5HSUp3eFVjd0svbWVGTTI2R3Mzdz09?=
MIME-Version: 1.0
X-OriginatorOrg: liquidtelecom.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: AS8PR03MB7622.eurprd03.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: c656cce3-3a55-4f06-28b6-08d994b55660
X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Oct 2021 17:08:00.7555 (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: Andrew.Alston@liquidtelecom.com
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB7797
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-GB
Content-Type: multipart/alternative; boundary="_000_CB45220AECE6492A8A37D189A71CDA2Bliquidtelecomcom_"
Archived-At: <https://mailarchive.ietf.org/arch/msg/v6ops/GbWiie-bjQ_Bp1JKB1PlDh_fPdc>
Subject: [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: Thu, 21 Oct 2021 17:08:35 -0000

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