Re: [sidr] preventing SKI collisions

Sean Turner <turners@ieca.com> Tue, 11 August 2015 17:09 UTC

Return-Path: <turners@ieca.com>
X-Original-To: sidr@ietfa.amsl.com
Delivered-To: sidr@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 463341ACDD7 for <sidr@ietfa.amsl.com>; Tue, 11 Aug 2015 10:09:24 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Level:
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_PASS=-0.001] autolearn=ham
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 03KQT_HcdDwO for <sidr@ietfa.amsl.com>; Tue, 11 Aug 2015 10:09:21 -0700 (PDT)
Received: from gateway32.websitewelcome.com (gateway32.websitewelcome.com [192.185.145.181]) (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 BB6571ACDD0 for <sidr@ietf.org>; Tue, 11 Aug 2015 10:09:21 -0700 (PDT)
Received: by gateway32.websitewelcome.com (Postfix, from userid 500) id 412AAD5C141BF; Tue, 11 Aug 2015 12:09:21 -0500 (CDT)
Received: from gator3286.hostgator.com (gator3286.hostgator.com [198.57.247.250]) by gateway32.websitewelcome.com (Postfix) with ESMTP id 31036D5C14137 for <sidr@ietf.org>; Tue, 11 Aug 2015 12:09:21 -0500 (CDT)
Received: from [96.231.216.201] (port=55919 helo=[172.16.0.112]) by gator3286.hostgator.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.85) (envelope-from <turners@ieca.com>) id 1ZPD3A-0000GN-9d; Tue, 11 Aug 2015 12:09:20 -0500
Content-Type: text/plain; charset="windows-1252"
Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\))
From: Sean Turner <turners@ieca.com>
In-Reply-To: <55C4D7C8.4000401@bbn.com>
Date: Tue, 11 Aug 2015 13:09:17 -0400
Content-Transfer-Encoding: quoted-printable
Message-Id: <97B4FBD1-BCE6-4D37-BC0C-07A211347FBF@ieca.com>
References: <555F436F.3080003@bbn.com> <2BF75857-6A5F-4260-B13B-0B9F6CE3FD98@ieca.com> <197E8AEA-D554-4DB4-885E-CFD55EF9E774@ripe.net> <m2wpx7pes6.wl%randy@psg.com> <55C4D7C8.4000401@bbn.com>
To: Richard Hansen <rhansen@bbn.com>, sidr wg list <sidr@ietf.org>
X-Mailer: Apple Mail (2.1878.6)
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - gator3286.hostgator.com
X-AntiAbuse: Original Domain - ietf.org
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - ieca.com
X-BWhitelist: no
X-Source-IP: 96.231.216.201
X-Exim-ID: 1ZPD3A-0000GN-9d
X-Source:
X-Source-Args:
X-Source-Dir:
X-Source-Sender: ([172.16.0.112]) [96.231.216.201]:55919
X-Source-Auth: sean.turner@ieca.com
X-Email-Count: 3
X-Source-Cap: ZG9tbWdyNDg7ZG9tbWdyNDg7Z2F0b3IzMjg2Lmhvc3RnYXRvci5jb20=
Archived-At: <http://mailarchive.ietf.org/arch/msg/sidr/4OaJL6YBWWx9C7faGW9xrYi7hPA>
Subject: Re: [sidr] preventing SKI collisions
X-BeenThere: sidr@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Secure Interdomain Routing <sidr.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/sidr>, <mailto:sidr-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/sidr/>
List-Post: <mailto:sidr@ietf.org>
List-Help: <mailto:sidr-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/sidr>, <mailto:sidr-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 11 Aug 2015 17:09:24 -0000

Saw you’re earlier msg, but figured I’d just reply to this one.

On Aug 07, 2015, at 12:07, Richard Hansen <rhansen@bbn.com> wrote:

> On 2015-08-07 06:35, Randy Bush wrote:
>>> This change would require certificates to be re-issued (or possibly
>>> keys to be rolled) all the way down from Trust Anchors. When the
>>> parent CA re-issues a certificate for the child CA with a new style
>>> SKI, then the child will have to re-issue its products with a new AKI.
>>> 
>>> This is not impossible, but not trivial either. Especially if a
>>> delegated model is used.
>> 
>> have we done a dnssec-v1?  we should be able to change hashes without a
>> flag day.  if not, we need to think.
> 
> We cannot change the SKI algorithm without a flag day.  Fortunately, if
> we prohibit CAs from publishing router certs with colliding SKIs within
> an AS (as proposed in my original email), we won't ever need to.

I think there’s probably three-related topics:

1) avoiding collisions in BGPsec,

2) chaining the way SKIs are generated for BGPsec certificates/messages, and

3) changing the way we make KIs for the entire RPKI.

I think what Richard and I are going back and forth about is #1, but others (including myself) seemed to be discussing #3 and I’m sure I was thinking about #2.  I agree with Randy that if we can’t change the algorithm used to generate KIs without a flag-day, then I think we need to think (more on this at the end).

> The following is an enumeration of some important points about the SKI
> that hopefully makes it easy to understand why my proposed change should
> be sufficient (credit for the idea goes to Matt Lepinski; I only came up
> with the specific wording):
> 
>  1.  The SKI length is currently fixed at 160 bits:
> 
>        * RFC6487 (and rfc6487bis) says 160-bit SHA1
>        * the rpki-rtr protocol has a fixed-length 160-bit SKI field
>        * the BGPsec protocol has a fixed-length 160-bit SKI field

Excellent - three of the example methods for defining a key identifier in RFC 7093 are 160-bit outputs:

      The keyIdentifier is composed of the leftmost 160-bits of the
      SHA-* hash of the value of the BIT STRING subjectPublicKey
      (excluding the tag, length, and number of unused bits).

Where * is 256, 384, and 512.

I think this helps out somewhat on topics #2 and #3 because we’d not have to change a bunch of other drafts to make the SKIs fit.

>  2.  The SKI does not contain an algorithm identifier OID, so there is
>      no way to communicate to RPs that a different algorithm was used
>      to produce the SKI.

There’s also the fourth option from RFC 7093, which is:

   The keyIdentifier is composed of the hash of the DER encoding of
   the SubjectPublicKeyInfo value

The SPKI does include the algorithm ID.

>  3.  SKI collisions must be prevented to keep an attacker from
>      temporarily disabling BGPsec.  If collisions were not prevented,
>      I believe the attacker could launch the following attack:
> 
>        a. generate tons of certificates with different keys but the
>           same SKI
>        b. publish the certificates
>        c. send a syntactically correct BGPsec update message where:
>             * the BGPsec_Path entries are made up (including invalid
>               signatures)
>             * the most recent entry uses the colliding SKI and the
>               attacker's AS number but a bad signature
>        d. sit back and enjoy a period of time where routers use the
>           invalid route while validation is pending
> 
>      The above attack works because routers will likely use the update
>      message as if it was valid until the cryptographic operations
>      determine otherwise (see bgpsec-protocols section 5 paragraph 2).
>      Because of the numerous colliding SKIs, it will take routers a
>      long time to exhaustively check every matching certificate before
>      it reaches the conclusion that the signature was not produced
>      by any of the matching certificates.
> 
>  4.  The only mechanism we have in place to prevent SKI collisions is
>      the SKI algorithm itself.
> 
>  5.  Because of points #3 and #4 above, RPs must validate the SKI in a
>      router certificate.  If RPs blindly trusted CAs to correctly
>      produce the correct SKI value, then it would be trivial for an
>      attacker to produce thousands of certificates with colliding SKI
>      values (e.g., just fill in the SKI with all zeros).
> 
>  6.  Because of points #2 and #5 above, we can't change the SKI
>      algorithm without a flag day.
> 
>  7.  Because of points #3, #4, and #6 above, BGPsec's security is tied
>      to the security of the unchangeable SKI algorithm.
> 
>  8.  SHA-1 is believed to be sufficient at the moment for preventing
>      SKI collisions, even with malicious actors.
> 
>  9.  Someone might eventually discover a way to easily produce SHA-1
>      collisions.  If so, SHA-1 would no longer be sufficient for
>      preventing SKI collisions with malicious actors.
> 
>  10. If we added a separate mechanism to prevent SKI collisions, it
>      would not matter how the SKI was generated.  The SKI (currently)
>      serves no security-relevant function other than quick key lookup,
>      so if another mechanism prevented SKI collisions then we could
>      switch to a cryptographically insecure algorithm like CRC64
>      (though I wouldn't recommend it).
> 
> Point #7 is what concerns me, but point #10 gives us an easy way out.
> The proposed change in my original email adds a separate mechanism to
> prevent SKI collisions.  By adopting the proposed change, RPs would
> invalidate all router certs with colliding SKIs (within an AS), thus
> breaking our dependency on the security of SHA-1.
> 
> So that you don't have to go find my original email, I've copied the
> proposal below.  Again, credit goes to Matt Lepinksi for the idea.
> 
> Add the following to the end of Section 3 in
> draft-ietf-sidr-bgpsec-pki-profiles:
> 
>    o To prevent denial-of-service attacks against RPs, Subject Key
>      Identifier collisions within an AS are not permitted.  Any
>      BGPsec Router Certificate that:
> 
>        *  references the same AS number in the Autonomous System
>           Identifier Delegation extension,
>        *  has a different key, and
>        *  has the same value in the Subject Key Identifier extension
> 
>      as another otherwise valid certificate MUST NOT be considered
>      valid.
> 
> -Richard

Okay so I want to agree.  But, I’m still trying to grok something you sent in an earlier msg (https://mailarchive.ietf.org/arch/msg/sidr/9vVsAheeeZMj7GI00nyGBDHBqPI) that I think is related when you said:

  RPs would not have to calculate/validate the SKI value; they would only
  need to check for collisions within an AS.

The first bit, says RPs don’t have to calculate/validate the SKI; I interpret the phrase “the SKI value” to mean “any SKI values - ever” and I like that.  But, the next part confuses me because I don’t get how RPs (assuming the “they” is an RP) do this check without calculating/validating an SKI?


On topic #2 (changes to BGPsec SKI generation):

I actually think we can just change the SKI generation method: BGPsec certificate are leaf certificates so there’s no AKI/SKI matching issue, we’re updating RFC 6487 to add differences anyway, and SKIs are only used in BGPsec messages.  If I wanted to fix this for the future (and this is just off the top of my head), I’d probably say something like the following to bgpsec-pki-profiles in a new SKI section:

  The keyIdentifier is composed of the leftmost 160-bits of the
  hash of the value of the BIT STRING subjectPublicKey
  (excluding the tag, length, and number of unused bits).
  The hash algorithm used is same one used when generating
  BGPsec messages; see Section 2 of [I-D.sidr-bgpsec-algs].

It’s SHA-256 now, but if BGPsec gets updated to be supercool-alg, then supercool-alg would be the algorithm used.


On topic #3:

Assuming we are willing to bite off generating KIs RPKI-wide, can we do as Tim suggested in his email (https://mailarchive.ietf.org/arch/msg/sidr/3H8Q7zT4t06lZXHx_iD3N188U2I) knowing that we’ve got an example method from RFC-7093 that is 160-bit in length?  Here’s a train of thought:

RFC 6497 says this in s4:

  Where a field value is specified
  here, this value MUST be used in conforming resource certificates.

and s7.2 has this:

   3.  The certificate contains all fields that MUST be present, as
        defined by this specification, and contains values for
        selected fields that are defined as allowable values by this
        specification.

and s9 has the following:

  If the resource certificate profile is changed in the future, e.g.,
  by adding a new extension or changing the allowed set of name
  attributes or encoding of these attributes, ...

followed by a bunch of procedures.

This train of thought makes me sad.

So without trying to sugar coat this at all: can we make a change akin to what Tim suggested without having to invoke all of the procedures in s9?

spt