[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: J4YRIc8ect0EAADvXCCDas4/4/Ad/q6lVTxH7GwvwTiHn4SMv2JbbQNIKVQ6ReDkV9JOSMQlfjfGyU1fOZfvaQkge9UCLqhTZQi9UWySlEiK6Os0v0hHuvuJuAgUGFVEEcloTEPSmdweJxJAIWS4WuXZJG+XlfNF0exsWEjA1TLBczMZ4vQq9AvtFp9ItQWHVcaiGkrk75O6C/3vLb/nWGGjd1Z1jGjVhzrj3QJ8MPcXc49KQkrdp9Q/xd/rlGJRNW/dje8a5b5wJmeb+cBDf2eSLBU0QciRVQTRTqlcXXDQfyF8GqYuwnn+57O+bE906OUOBEJsKcDgug3+HPtvLm8v7D+6AAJHLVOZlaUAX8lMsLdg7VccpkY5sGIA0R9xPrwhF6gTDrR6iix6XVdNeP1oS967D7OYC/o2qE1HFH8AN2wR+SeQ3xUVIGXb2TfVkyPG55yfqde7yVjKLWhwvod8S1KgKF3W8LL6kjz1ZpTG/zDnqkm5TkjDIAvJ6zodE3vvdktBTfgzDUj6cSrOVufHKBN6PEKB0ZFfInQV3e+y9rkTMZ9W94ykiRi/NFX8GUfPrfJU4L4un/1WrAwWES1g1G0ilaqgrtVsTHhkw8czjnfQmRW848h/gkmZqLRPzS3xRk44KPZlc4OqMxxo9kLCFrHMm4COgV76yQZpu0mEteHefkz9xHQ34uWRWOqZdCKlPuWyUH2nGXbpqTn1lIuiJok7tBK1ChW+eSSIlB+iZueXEPVHgDBcNv/r6nr42sB1odAvt8PrcE5+Yl2YuQmd4ecsQNygpbwFwmcgDYXgr2OZAwW3ob/kPEk7OdYwAXF2/dw2r38tqckd2yncI5nRzQ/+4ctHJc5J3iDIAmPUsswyzTWVDSwhqwM78WBsnCOTbxkx6NyCRaW5DpUuS1AxEvWrbwjBd6LbrkY8dAysDG0nfzBpmw0zaECPmnP2ZjJH9WlvTWfSfOii/tkTues2FDmLX6EjWUywvFtTX4SKElRSo5eJczbd2sB90fdK7KyyvTrDI0kHw4LBem+Raqq97H4YMrujIK/uHPAS8wJDJ6y48xYVHfyKSpfNZA/rr80/Hb08WALL5WNy6Ov50IAetuRC1lx9t/fh+qSEkW1F+xhm+Y521VCa7jr5sHB2GQHhx9IXzdn5TFImqLixXGMkkSv8FyDTtA/v+aEZZFiuAjwxJarOvPnqShhr5RPdxogVaTce2vBipOndulRSq7g1mIvUXoTo1pRWNnn7uw+gk/ibG+NA8isq+beI5FwKizwffJEan1wXmBgPeReWWqLRhFBbS08B0anY12WVO3PuvvmMQPWPyRPRfPDyJfOEwAUqVy21Ir3hodDCw+C2ugZq7dqB6OMFvDpyd4BaDYibU+dz5OvI+4Q13OhZDixfLiXS/RW/D+/Ti8cHnTe0yxHYv6LnMpI1HdhV/wEaQN3JD+2YZAOirABtj5gP5MYylDuvUOuOVD1CVceIt7PoijmGUiQeMjK8YeOu+Fy6NrZWl7p75CunCpgeGfdmSawOvnGIJwxUcwK/meFM26Gs3w==
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