Re: [core] WG Adoption Call for draft-mattsson-core-coap-attacks

supjps-ietf@jpshallow.com Fri, 25 February 2022 20:32 UTC

Return-Path: <jon.shallow@jpshallow.com>
X-Original-To: core@ietfa.amsl.com
Delivered-To: core@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 3AE553A0872 for <core@ietfa.amsl.com>; Fri, 25 Feb 2022 12:32:20 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=unavailable autolearn_force=no
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 gW_YOui82vyA for <core@ietfa.amsl.com>; Fri, 25 Feb 2022 12:32:15 -0800 (PST)
Received: from mail.jpshallow.com (mail.jpshallow.com [217.40.240.153]) (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 DE6A53A0845 for <core@ietf.org>; Fri, 25 Feb 2022 12:32:13 -0800 (PST)
Received: from mail2.jpshallow.com ([192.168.0.3] helo=N01332) by mail.jpshallow.com with esmtp (Exim 4.92.3) (envelope-from <jon.shallow@jpshallow.com>) id 1nNhG7-0000P5-9g; Fri, 25 Feb 2022 20:32:11 +0000
From: supjps-ietf@jpshallow.com
To: Achim Kraus <achimkraus@gmx.net>
Cc: mohamed.boucadair@orange.com, 'Marco Tiloca' <marco.tiloca=40ri.se@dmarc.ietf.org>, core@ietf.org
References: <cadf5151-8f7f-9311-6987-de5bf533abe2@ri.se> <28040_1645773815_621883F7_28040_64_1_787AE7BB302AE849A7480A190F8B9330354999C4@OPEXCAUBMA2.corporate.adroot.infra.ftgroup> <55ce01d82a31$f052c530$d0f84f90$@jpshallow.com> <01663e0e-ccb7-84d2-08aa-3792799a783c@gmx.net>
In-Reply-To: <01663e0e-ccb7-84d2-08aa-3792799a783c@gmx.net>
Date: Fri, 25 Feb 2022 20:32:05 -0000
Message-ID: <5a5401d82a86$c10bf440$4323dcc0$@jpshallow.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-Mailer: Microsoft Outlook 14.0
Thread-Index: AQHArwUJYTgjKmdOOjJp4CS3KJofbgKK05zqAWwAISkCrAJCDayei2zQ
Content-Language: en-gb
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/tuI9NNtx5t3NDsK0zfhdvNGCmEg>
Subject: Re: [core] WG Adoption Call for draft-mattsson-core-coap-attacks
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Constrained RESTful Environments \(CoRE\) Working Group list" <core.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/core>, <mailto:core-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/core/>
List-Post: <mailto:core@ietf.org>
List-Help: <mailto:core-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/core>, <mailto:core-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 25 Feb 2022 20:32:22 -0000

Hi Achim,

draft-mattsson-core-coap-attacks has a focus on using Request-Tag to mitigate attacks.  Usage of ETag is not mandated in RFC7252 or RFC7959 as far as I can tell (but is in to-be-RFC9177), but using ETag with Block2 mitigates potential attack confusion. See attack below.

Otherwise, please see inline.

Regards

Jon

> -----Original Message-----
> From: Achim Kraus [mailto: achimkraus@gmx.net]
> Sent: 25 February 2022 16:22
> To: jon@jpshallow.com
> Cc: mohamed.boucadair@orange.com; 'Marco Tiloca'; core@ietf.org
> Subject: Re: [core] WG Adoption Call for draft-mattsson-core-coap-attacks
> 
> Hi Jon,
> 
> I'm not sure about:
> 
>  > Again using Block-Wise transfers, there has not been consideration
> for a delay attack causing the server to send back the wrong data in a
> BLOCK2 response.  See
> https://github.com/core-wg/echo-request-tag/issues/77 .  If the attacker
> delays the first request (which triggers a BLOCK2 response), and then
> sends it just before/after the second request (also triggering a BLOCK2
> response), the request for the next block for, say the second request,
> from the client may get back the block from either the first or second
> request.  This can only be mitigated using the Request-Tag on each
> request, even though BLOCK1 is not being used for the request.  I think
> this attack also needs to be included.
> 
> Does this refer to RFC7959?

Jon> Yes, as Block2s are being used as well as RFC9175
> 
>  > may get back the block from either the first or second request.
> 
> But the response will contain a token, which is used for
> request-response matching. So, do you assume, that both request are
> using the same token (maybe then more a unintended violation of the
> token uniqness)?

Jon> No.  I would be expecting the Token to be different in each request that asks for the next payload of the body.  Use of the same Token is not recommended as per RFC9175, but people do not realize that an empty token should not be used across multiple requests (another attack if "Foe" was removing tokens as the CoAP packets passed through...).

Jon> Client gets earlier value (ETag not used) against what it thought was the second request.

   Client   Foe   Server
      |      |      |
      +------X      |    POST "request" T:1 { "offset":0, "length":2000}
      |      |      |
      +------------->    POST "request" T:2 { "offset":4000, "length":2000}
      |      |      |
      |      @------>    POST "request" T:1 { "offset":0, "length":2000}
      |      |      |
      <-------------+    2.04 T:2 Block2:0/1/1024 { data containing 4000:1024 }
      |      |      |
      <-------------+    2.04 T:1 Block2:0/1/1024 { data containing 0:1024 }
      |      |      |
      +------------->    POST "request" T:3 Block2:0/_/1024
                         server - is this continuation of request using T:1 or T:2 ?
      |      |      |
      <-------------+    2.04 T:3 Block2:1/_/1024 { data containing 1024:2000 }
                         Was this the expected data ?
      |      |      |

This is fixed if Request differentiating ETag is used in the response. The client may not be able to get the missing secondary block from the alternative request, unless Request-Tag is used in the initial request (hence issue 77).

~Jon>

> 
> best regards
> Achim
> 
> Am 25.02.22 um 11:24 schrieb supjps-ietf@jpshallow.com:
> > Hi All,
> >
> > I likewise am in favor of this document, but would like to see a few changes /
> addition.
> >
> > Med is actually referring to 2.4, but this made me realize there was a trap of
> seeing Block and hence thinking RFC7959 for 2.1 - "The Block Attack" which
> actually has no reference to CoAP blocks.  A better section title could be "The
> Blocking Attack" and s/Block Attack/Blocking Attack/ elsewhere.
> >
> > For 2.4, "Fragment" in terms of CoAP blocks is not defined, and is not used in
> RFC7959 (RFC7959 refers to fragmentation issues outside of the CoAP layer), so
> is unclear that "fragment" is meant to be referring to a CoAP RFC7959 (or
> draft-ietf-core-new-block to-be-RFC9177) block.
> >
> > Thus, "2.4. The Request CoAP Block Rearrangement Attack" is a step in the
> right direction for me.  Then most of the usage of the word fragment needs to
> be replaced with block.
> >
> > As a note for mitigating 2.4.1, to-be-RFC9177 requires the use of Request-Tag
> (https://datatracker.ietf.org/doc/html/draft-ietf-core-new-block#section-4.3)
> and good use of tokens (https://datatracker.ietf.org/doc/html/draft-ietf-core-
> new-block#section-6).
> >
> > The lost blocks recovery mechanisms in to-be-RFC9177 mitigate the risk of
> the wrong block being processed in a request by the server.
> >
> > Again using Block-Wise transfers, there has not been consideration for a delay
> attack causing the server to send back the wrong data in a BLOCK2 response.
> See https://github.com/core-wg/echo-request-tag/issues/77 .  If the attacker
> delays the first request (which triggers a BLOCK2 response), and then sends it
> just before/after the second request (also triggering a BLOCK2 response), the
> request for the next block for, say the second request, from the client may get
> back the block from either the first or second request.  This can only be
> mitigated using the Request-Tag on each request, even though BLOCK1 is not
> being used for the request.  I think this attack also needs to be included.
> >
> > Regards
> >
> > Jon
> >
> >> -----Original Message-----
> >> From: mohamed.boucadair@orange.com
> [mailto:mohamed.boucadair@orange.com]
> >> Sent: 25 February 2022 07:24
> >> To: Marco Tiloca; core@ietf.org WG (core@ietf.org)
> >> Subject: Re: [core] WG Adoption Call for draft-mattsson-core-coap-attacks
> >>
> >> Hi all,
> >>
> >> I support adoption.
> >>
> >> It would helpful to explicit in Section 2.1 that this is about 7959, not the
> new
> >> block (to-be-RFC9177). Assessing the case of the new-block would be useful
> as
> >> well.
> >>
> >> Thank you.
> >>
> >> Cheers,
> >> Med
> >>
> >>> -----Message d'origine-----
> >>> De : core <core-bounces@ietf.org> De la part de Marco Tiloca
> >>> Envoyé : jeudi 24 février 2022 17:21
> >>> À : core@ietf.org WG (core@ietf.org) <core@ietf.org>
> >>> Objet : [core] WG Adoption Call for draft-mattsson-core-coap-attacks
> >>>
> >>> Dear all,
> >>>
> >>> This mail starts a 2 week Working Group Adoption Call for draft-
> >>> mattsson-core-coap-attacks [1].
> >>>
> >>> Please, provide your feedback by Wednesday, March 10.
> >>>
> >>> Best,
> >>> Marco and Jaime
> >>>
> >>> [1] https://datatracker.ietf.org/doc/draft-mattsson-core-coap-attacks/
> >>>
> >>> --
> >>> Marco Tiloca
> >>> Ph.D., Senior Researcher
> >>>
> >>> Division: Digital System
> >>> Department: Computer Science
> >>> Unit: Cybersecurity
> >>>
> >>> RISE Research Institutes of Sweden
> >>> https://www.ri.se
> >>>
> >>> Phone: +46 (0)70 60 46 501
> >>> Isafjordsgatan 22 / Kistagången 16
> >>> SE-164 40 Kista (Sweden)
> >>
> >>
> >>
> ___________________________________________________________________
> >> ______________________________________________________
> >>
> >> Ce message et ses pieces jointes peuvent contenir des informations
> >> confidentielles ou privilegiees et ne doivent donc
> >> pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce
> >> message par erreur, veuillez le signaler
> >> a l'expediteur et le detruire ainsi que les pieces jointes. Les messages
> >> electroniques etant susceptibles d'alteration,
> >> Orange decline toute responsabilite si ce message a ete altere, deforme ou
> >> falsifie. Merci.
> >>
> >> This message and its attachments may contain confidential or privileged
> >> information that may be protected by law;
> >> they should not be distributed, used or copied without authorisation.
> >> If you have received this email in error, please notify the sender and delete
> this
> >> message and its attachments.
> >> As emails may be altered, Orange is not liable for messages that have been
> >> modified, changed or falsified.
> >> Thank you.
> >>
> >> _______________________________________________
> >> core mailing list
> >> core@ietf.org
> >> https://www.ietf.org/mailman/listinfo/core
> >
> > _______________________________________________
> > core mailing list
> > core@ietf.org
> > https://www.ietf.org/mailman/listinfo/core