[websec] Key pinning for DSA keys with inherited domain params

"Manger, James H" <James.H.Manger@team.telstra.com> Sat, 10 December 2011 14:30 UTC

Return-Path: <James.H.Manger@team.telstra.com>
X-Original-To: websec@ietfa.amsl.com
Delivered-To: websec@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B2CFF21F88B7 for <websec@ietfa.amsl.com>; Sat, 10 Dec 2011 06:30:41 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.901
X-Spam-Level:
X-Spam-Status: No, score=-0.901 tagged_above=-999 required=5 tests=[AWL=0.001, BAYES_00=-2.599, HELO_EQ_AU=0.377, HOST_EQ_AU=0.327, RELAY_IS_203=0.994]
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 muGQ9ybw9N1V for <websec@ietfa.amsl.com>; Sat, 10 Dec 2011 06:30:41 -0800 (PST)
Received: from ipxbvo.tcif.telstra.com.au (ipxbvo.tcif.telstra.com.au [203.35.135.204]) by ietfa.amsl.com (Postfix) with ESMTP id D0ABF21F8564 for <websec@ietf.org>; Sat, 10 Dec 2011 06:30:38 -0800 (PST)
X-IronPort-AV: E=Sophos;i="4.71,331,1320584400"; d="scan'208";a="55205894"
Received: from unknown (HELO ipcbvi.tcif.telstra.com.au) ([10.97.217.204]) by ipobvi.tcif.telstra.com.au with ESMTP; 11 Dec 2011 01:30:36 +1100
X-IronPort-AV: E=McAfee;i="5400,1158,6555"; a="44953114"
Received: from wsmsg3753.srv.dir.telstra.com ([172.49.40.174]) by ipcbvi.tcif.telstra.com.au with ESMTP; 11 Dec 2011 01:30:36 +1100
Received: from WSMSG3153V.srv.dir.telstra.com ([172.49.40.159]) by WSMSG3753.srv.dir.telstra.com ([172.49.40.174]) with mapi; Sun, 11 Dec 2011 01:30:35 +1100
From: "Manger, James H" <James.H.Manger@team.telstra.com>
To: "websec@ietf.org" <websec@ietf.org>
Date: Sun, 11 Dec 2011 01:30:34 +1100
Thread-Topic: Key pinning for DSA keys with inherited domain params
Thread-Index: Acy3SEcePub/mpKpSQiq3HeRF5fpVA==
Message-ID: <76E2AAC7-2070-4C98-B0EE-08BE5D2B0CB9@team.telstra.com>
Accept-Language: en-US, en-AU
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
acceptlanguage: en-US, en-AU
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
Subject: [websec] Key pinning for DSA keys with inherited domain params
X-BeenThere: websec@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Web Application Security Minus Authentication and Transport <websec.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/websec>, <mailto:websec-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/websec>
List-Post: <mailto:websec@ietf.org>
List-Help: <mailto:websec-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/websec>, <mailto:websec-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 10 Dec 2011 14:30:41 -0000

A DSA public key consists of an integer y, plus domain parameters p, q, and g. The domain parameters may be included in a SubjectPublicKeyInfo value for the key in a certificate, but they may also be omitted if the CA that issued the certificate uses the same domain parameters for its key. [See RFC 3279 Algorithms and Identifiers for PKIX, section 2.3.2; http://tools.ietf.org/html/rfc3279#section-2.3.2]

This seems like a problem for key pinning as specified in draft-ietf-websec-key-pinning-01, where a pin is the hash of a SubjectPublicKeyInfo value. My guess is that it is insecure for a pin to only cover y, but not p, q, and g.

Without going back to the maths of DSA, I suspect an attacker can find another set of domain parameters and private key that have the same public key (y) as a victim. This attacker key can have the same pin as the victim's.

I think the same issue applies to ECDSA and ECDH keys, and potentially other public key algorithms as well.

Possible solutions:

1. Say the pinning mechanism MUST NOT be used when a SubjectPublicKeyInfo value does not completely specify the public key, such as when holding a DSA key without its domain parameters. This would be acceptable if no one uses the inherit-parameters-from-the-CA option. I have no idea whether or not that is true.

2. Define a special rule for each known algorithm that can inherit parameters (such as DSA): the domain parameters MUST be added (from the CA cert, for instance) before calculating the pin. That is a bit of a burden for all implementations.

--James Manger