Re: [dtn-security] Re(4): Including fragment offset in the correlator doesn't prevent all fragment collisions.

Amy Alford <aloomis@sarn.org> Sun, 14 April 2013 20:50 UTC

Return-Path: <aloomis@sarn.org>
X-Original-To: dtn-security@ietfa.amsl.com
Delivered-To: dtn-security@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 62ADC21F8C98 for <dtn-security@ietfa.amsl.com>; Sun, 14 Apr 2013 13:50:51 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.976
X-Spam-Level:
X-Spam-Status: No, score=-2.976 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-1]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vkWgWv40FAgF for <dtn-security@ietfa.amsl.com>; Sun, 14 Apr 2013 13:50:50 -0700 (PDT)
Received: from mail-qa0-f43.google.com (mail-qa0-f43.google.com [209.85.216.43]) by ietfa.amsl.com (Postfix) with ESMTP id AA1AE21F851C for <dtn-security@irtf.org>; Sun, 14 Apr 2013 13:50:49 -0700 (PDT)
Received: by mail-qa0-f43.google.com with SMTP id bs12so387509qab.2 for <dtn-security@irtf.org>; Sun, 14 Apr 2013 13:50:44 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:x-gm-message-state; bh=2O8z9prelcY9zI0Ta2i8CNQoyqTRZB6Nl18sBd6OtM0=; b=DcJXJe6/BUbjs6s4CBm4rsmX00YAdIdZkhWeWPvEdO+Z0i83HmONOsIVmTvfVMZbKz Di/0f8oHrnidyuwZbWyOs1l5tLEwUWwJzdxSy4WZ4uYD5cy5Y/rhCZbH0gNBC4flwfmy B5vUYMEQJXPjQs4QlSDqvpdWyfWlq26vFYF2hg/IA/CZa3F9Teu/2hu95Cml+YUAZBix 2waD7VxeVmgLTg/v6lV12iheZlJK2mxJgDIqzdApokSFDWVP2ICgdCfkK1McirxPKnKk +M/77ZObCQ29FxzpkOQ3kmY8TUg2c2KpZ4Xx1Hab6qp37FpyA5eD6uLZXznF7lDSpnlx NA3A==
MIME-Version: 1.0
X-Received: by 10.224.210.10 with SMTP id gi10mr20066585qab.36.1365972644112; Sun, 14 Apr 2013 13:50:44 -0700 (PDT)
Received: by 10.49.76.71 with HTTP; Sun, 14 Apr 2013 13:50:43 -0700 (PDT)
In-Reply-To: <A5BEAD028815CB40A32A5669CF737C3B235B2E1E@ap-embx-sp40.RES.AD.JPL>
References: <CAB9rx+85HHsNj=EhmsqhCdtY5k=S4p1Jgzz4VsmEC+43ERygWA@mail.gmail.com> <20130320011114.1072992195@smtp.mail.me.com> <CAB9rx+_EK7u8kkDhscBdqnGHYSeoROTSfhNaALZUodMt4em=_Q@mail.gmail.com> <20130323005838.947157858@smtp.mail.me.com> <CAB9rx+-kKNEUH0VWA_ffrcHfh59eSAxbgHNXWhkm+BrC44rqWw@mail.gmail.com> <20130323213252.461319491@smtp.mail.me.com> <CAB9rx+-5yowPPSHfmME8Mhu5Y1B6hzVOPyRk3qpsZ200A=n6WA@mail.gmail.com> <1365876632.5273.8820.camel@mightyatom> <CAB9rx+-3H6coewGAL8w4H6eJ4-R91DUZ-y3tjPOqewW-R2JF=A@mail.gmail.com> <A5BEAD028815CB40A32A5669CF737C3B235B2E1E@ap-embx-sp40.RES.AD.JPL>
Date: Sun, 14 Apr 2013 16:50:43 -0400
Message-ID: <CAB9rx+-t5NhmwUzUSbLLkvp75vo+-4MHuj0Sz2+n7XLcM8HKPQ@mail.gmail.com>
From: Amy Alford <aloomis@sarn.org>
To: "Burleigh, Scott C (313B)" <scott.c.burleigh@jpl.nasa.gov>
Content-Type: multipart/alternative; boundary=20cf300faeed39bc9104da584afe
X-Gm-Message-State: ALoCoQkml2gHP4hihmudp0Ss8C0P8IN18ltstwgz52OpXonc40PM69bvzaD/b2PLalNkPvSP2sE2
Cc: dtn-security <dtn-security@irtf.org>
Subject: Re: [dtn-security] Re(4): Including fragment offset in the correlator doesn't prevent all fragment collisions.
X-BeenThere: dtn-security@irtf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: "The Delay-Tolerant Networking Research Group \(DTNRG\) - Security." <dtn-security.irtf.org>
List-Unsubscribe: <https://www.irtf.org/mailman/options/dtn-security>, <mailto:dtn-security-request@irtf.org?subject=unsubscribe>
List-Archive: <http://www.irtf.org/mail-archive/web/dtn-security>
List-Post: <mailto:dtn-security@irtf.org>
List-Help: <mailto:dtn-security-request@irtf.org?subject=help>
List-Subscribe: <https://www.irtf.org/mailman/listinfo/dtn-security>, <mailto:dtn-security-request@irtf.org?subject=subscribe>
X-List-Received-Date: Sun, 14 Apr 2013 20:50:51 -0000

5050 allows any node to reassemble fragments.  So, if fragmentation occurs
before security blocks are added, any subsequent node may then reassemble
the bundle.

Additionally, hop-by-hop ciphersuites may have intermediate non-security
aware nodes.  These can potentially fragment/reassemble, creating the same
overlapping fragmentation path/security path scenarios.

The example I sent out earlier in response to Peter Lovell is still a
possibility if you have a PIB ciphersuite that uses two blocks (one before
the payload and one after).  BIBE does mitigate this, since we can use the
"DO_NOT_FRAGMENT" flag whenever we add a two block PIB, and then
encapsulate.  Once we've encapsulated, we can fragment again.

There's a problem with enforcing the one logical security block of each
type/target per bundle rule if a bundle is reassembled by an intermediate
node. Security blocks may have been applied to different fragments which
are then recombined in such a way that there is more than one logical
security block of the same type/target.  These may apply to overlapping
payload regions, or even the same payload region (depending on how the
recombining node handles receiving duplicate fragments over different
links).

These are the cases I've thought of.  I'm nervous that there's enough
complexity in the intersection of fragmentation/encapsulation/BSP that it's
hard to be confident that all the possible combinations will work correctly.

- Amy


On Sat, Apr 13, 2013 at 8:25 PM, Burleigh, Scott C (313B) <
scott.c.burleigh@jpl.nasa.gov> wrote:

>  Amy, I certainly agree on the potential for Bad Things happening when
> fragmentation and security aren't cleanly nested.  Can you say a little
> more about how the proposed new BSP draft's support for security sources
> could expose nodes to these problems?
>
>  Scott
>  ------------------------------
> *From:* dtn-security-bounces@irtf.org [dtn-security-bounces@irtf.org] on
> behalf of Amy Alford [aloomis@sarn.org]
> *Sent:* Saturday, April 13, 2013 3:12 PM
> *To:* Elwyn Davies
> *Cc:* dtn-security
> *Subject:* Re: [dtn-security] Re(4): Including fragment offset in the
> correlator doesn't prevent all fragment collisions.
>
>   If you think about a "fragmentation path" similar to a security path,
> whenever fragmentation paths and security paths overlap (instead of one
> nesting inside the other), Bad Things (TM) are probably going to happen in
> DTN2.
>
> If it's fragment -> add bsp -> defragment -> remove bsp, you're up against
> the fact that defragmentation doesn't necessarily preserve enough info to
> validate the BSP blocks.  Even if it does, DTN2 currently doesn't recognize
> that a set of valid BSP blocks that cover the payload are enough to satisfy
> policy requirements.
>
>  If it's add bsp -> fragment -> remove bsp -> defragment, you're
> obviously sunk because you can't validate the BSP blocks which apply to the
> whole payload when you only have a fragment.  In this case, you obviously
> need to reconstitute the bundle before you remove the BSP blocks.
>
>  This doesn't even touch the headaches involved with multiple BSP
> instances and multiple fragmentation.
>
>  BiB will need to deal with the second case (the easy one - DTN2 will
> probably handle this with no changes), but avoids the first case because an
> encapsulated fragment is not itself a fragment (so it can't be
> reconstituted until after it's been decapsulated).
>
>  The new BSP draft may not sidestep these problems though, because it
> still allows security sources and hop-by-hop ciphersuites still need to be
> able to handle non-security-aware nodes in the middle.
>
>
>
>
> On Sat, Apr 13, 2013 at 2:10 PM, Elwyn Davies <elwynd@folly.org.uk> wrote:
>
>> Hi.
>>
>> It just occurred to me that the way DTN2 handles fragment payloads
>> probably gets very screwed up if two paths either with different
>> encrypted security tunnels or with one encrypted and one unencrypted
>> converge at some point after fragmentation.  I haven't looked in detail
>> into the code, but I suspect that there are some cases in which order
>> of delivery via the two different paths might lead to  the payload
>> getting a mix of data from the two sources and becoming unintelligible.
>>
>> Not certaim if I am right, but may be another argument for using b-i-b
>> encapsulation.
>>
>> Regards,
>> Elwyn
>>
>> On Mon, 2013-03-25 at 15:58 -0400, Amy Alford wrote:
>> >
>> >
>> > On Sat, Mar 23, 2013 at 5:32 PM, Peter Lovell <plovell@mac.com> wrote:
>> >         Hi Amy,
>> >
>> >         Amy Alford <aloomis@sarn.org> wrote:
>> >
>> >         >Yes, my example was assuming a PIB ciphersuite that used two
>> >         blocks
>> >         >(similar to BAB).  That case is the most problematic, because
>> >         when the
>> >         >bundle is fragmented, the two blocks will end up in separate
>> >         fragments.
>> >         > Otherwise, the correlator collision isn't a problem as long
>> >         as reassembly
>> >         >happens at the destination.
>> >
>> >         PIB is, in some ways, a more difficult scenario than PCB. When
>> >         a bundle with PCB arrives at the security-dest, the payload is
>> >         decrypted (and other blocks as appropriate) and the PCB itself
>> >         is deleted. But some folks want to have PIBs remain even after
>> >         verification, as evidence I guess. That is messy.
>> > Leaving PIBs on after verification is problematic anyway, if the PIB
>> > was added after a PCB.  Once the PCB reaches it's security
>> > destination, the PIB is invalid anyhow.
>> >
>> >
>> >         Is there a specific reason for a two-block PIB?
>> >
>> > 6257 mentions the idea of PIB ciphersuites that use a trailing block
>> > similar to BAB.  I assume you'd still want an up front block to warn
>> > nodes that are doing one pass processing that they need to start
>> > hashing.
>> >
>> >
>> >         >> As you can see, this is a quite involved process. A couple
>> >         of things are
>> >         >> worthy of note:
>> >         >> 1. correlators are local to their bundle
>> >         >> 2. a block with a correlator may be encapsulated, with PCB
>> >         for example.
>> >         >> The original correlator is hidden until decapsulation
>> >         occurs (not shown
>> >         >> above for sake of brevity :)
>> >         >> 3. reassembly is a very, very complex process.
>> >         >>
>> >         >I was pondering how to support these sorts of cases (which
>> >         end up needing
>> >         >validation and reassembly interleaved somehow).  In thinking
>> >         about it, I
>> >         >started running into scenarios that aren't supportable.  The
>> >         example I gave
>> >         >is one (which I think shows that bundles with two block PIBs
>> >         need to have
>> >         >the do not fragment flag set).
>> >         It may be sufficient to apply the
>> >         replicate-key-info-in-every-block rule. I don't know without
>> >         thinking about it some more.
>> >
>> >
>> > I think it would fix the example I gave.  The last fragment would
>> > contain both the leading and trailing PIB blocks.  The leading block
>> > could be used to match this up with the corresponding fragment (which
>> > also has a leading PIB block but is missing the trailing one).  It
>> > would be a pain in terms of processing, since defragmentation would
>> > need to match up the corresponding fragments by comparing their
>> > leading PIB blocks.
>> >
>> >
>> >
>> >
>> >         >Additionally, in general, if an intermediate node reassembles
>> >         fragments
>> >         >that have had BSP blocks added after fragmentation, we can't
>> >         validate.  Too
>> >         >much information is lost on reassembly (even if it's done
>> >         sensibly).  5050
>> >         >allows intermediate nodes to reassemble, but doesn't mandate
>> >         a procedure
>> >         >for reassembling the extension blocks (so it may not be done
>> >         sensibly).
>> >
>> >         It's not just an issue of reassembling/reordering extension
>> >         blocks. As the final example shows, any attempt to
>> >         reassemble-first is doomed to failure because the two parts
>> >         were encrypted under different second-stage keys.
>> >
>> >         It's clear to me that reassembly of bundles containing
>> >         security blocks must be done in concert with security
>> >         processing. This needs to be incorporated into any update to
>> >         5050. And, as you say, there are cases that aren't supportable
>> >         with the capabilities we now have.
>> >
>> > Yes.  In general, nodes shouldn't reassemble a bundle if they don't
>> > understand all the extension blocks.  BSP aware nodes shouldn't
>> > reassemble fragments except in concert with security processing.
>> >
>> >
>> >
>> >
>> >         Regards.....Peter
>> >
>> >
>>  > _______________________________________________
>> > dtn-security mailing list
>> > dtn-security@irtf.org
>> > https://www.irtf.org/mailman/listinfo/dtn-security
>>
>>
>