Re: [openpgp] OpenPGP SEIP downgrade attack

Peter Gutmann <pgut001@cs.auckland.ac.nz> Tue, 06 October 2015 01:49 UTC

Return-Path: <pgut001@cs.auckland.ac.nz>
X-Original-To: openpgp@ietfa.amsl.com
Delivered-To: openpgp@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 2A3301B3533 for <openpgp@ietfa.amsl.com>; Mon, 5 Oct 2015 18:49:48 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.91
X-Spam-Level:
X-Spam-Status: No, score=-1.91 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, T_RP_MATCHES_RCVD=-0.01] 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 K36KzcnwNxeO for <openpgp@ietfa.amsl.com>; Mon, 5 Oct 2015 18:49:43 -0700 (PDT)
Received: from mx4.auckland.ac.nz (mx4.auckland.ac.nz [130.216.125.248]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 63DF31B3531 for <openpgp@ietf.org>; Mon, 5 Oct 2015 18:49:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=auckland.ac.nz; i=@auckland.ac.nz; q=dns/txt; s=mail; t=1444096183; x=1475632183; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=tbRtOOk4ngON0QHEycV5vFep2h+TsURNj9Vz9a3HGHA=; b=YpttZNUwaD5GOx3KD6Jno3loQVvYmPZykfZnZBDSSS1cO/zehaP0phas HJ8kCd0ZqAVb3oWpvgvO9GVG6CWFse4QXnaNvP3qB2Gr0OUWppufiWu1e sSMuMZY3JOMpHEL9E3g2/rPewq5PYe9U0UgU56NYaXG/kVC29ep3SUBbe irGVdYk3R8Z//bqSkkUJXPKO+idCM4XWX2axC3Z/WXld0ZYtWHbCe96Kq HnFLx9VllssKsLuC7znm9EQAABx87XX8AlYWxSB1xb0nfmrbWXN+QdlqS o3V8AIsfBrHaNOT2tBbu/aKsjJRYmcDY5VQevYs59PyHqfgf4YLo8H6Fc A==;
X-IronPort-AV: E=Sophos;i="5.17,641,1437393600"; d="scan'208";a="46650546"
X-Ironport-HAT: MAIL-SERVERS - $RELAYED
X-Ironport-Source: 130.216.4.125 - Outgoing - Outgoing
Received: from uxchange10-fe3.uoa.auckland.ac.nz ([130.216.4.125]) by mx4-int.auckland.ac.nz with ESMTP/TLS/AES128-SHA; 06 Oct 2015 14:49:41 +1300
Received: from UXCN10-5.UoA.auckland.ac.nz ([169.254.5.51]) by uxchange10-fe3.UoA.auckland.ac.nz ([169.254.143.234]) with mapi id 14.03.0174.001; Tue, 6 Oct 2015 14:49:41 +1300
From: Peter Gutmann <pgut001@cs.auckland.ac.nz>
To: Jonas Magazinius <jonas.magazinius@assured.se>, "openpgp@ietf.org" <openpgp@ietf.org>, "cryptography@metzdowd.com" <cryptography@metzdowd.com>, "cfrg@mail.ietf.org" <cfrg@mail.ietf.org>
Thread-Topic: [openpgp] OpenPGP SEIP downgrade attack
Thread-Index: AQHQ/3dAIgzGDRicekamqnyxIGnZTZ5dsvDI
Date: Tue, 6 Oct 2015 01:49:40 +0000
Message-ID: <9A043F3CF02CD34C8E74AC1594475C73F4B28366@uxcn10-5.UoA.auckland.ac.nz>
References: <56128436.40607@assured.se>
In-Reply-To: <56128436.40607@assured.se>
Accept-Language: en-NZ, en-GB, en-US
Content-Language: en-NZ
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [130.216.158.4]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Archived-At: <http://mailarchive.ietf.org/arch/msg/openpgp/ldETeC_GELVAiUuGJJP2Gso5_7s>
Subject: Re: [openpgp] OpenPGP SEIP downgrade attack
X-BeenThere: openpgp@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: "Ongoing discussion of OpenPGP issues." <openpgp.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/openpgp>, <mailto:openpgp-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/openpgp/>
List-Post: <mailto:openpgp@ietf.org>
List-Help: <mailto:openpgp-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/openpgp>, <mailto:openpgp-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 06 Oct 2015 01:49:48 -0000

Jonas Magazinius <jonas.magazinius@assured.se>; writes:

>I've recently been analysing the OpenPGP standard and have found that it 
>is vulnerable to a chosen-ciphertext attack to downgrade an SEIP packet 
>to a plain SE packet. 

Nice work!

>Part of the reason SEIP and MDC was introduced ~15 years ago was to deal 
>with exactly this problem. 

It's always been a quick hack though.  I didn't implement MDC for a long 
time because I was waiting for it to be done properly (encrypt-then-MAC),
but eventually I decided that a hack was better than nothing at all.  It's
really not hard to do properly, just take what CMS / S/MIME did and convert
the bit-bagging to PGP format [0].  Encrypting a non-keyed hash in CFB mode 
of all things is just asking for trouble.

>Different implementations handle SE packets differently.

Is the SEIP -> SE rewrite completely transparent, or are there implementation
quirks/peculiarities that make it work in some cases and not others?  It'd
be interesting to have a sample of a SEIP message with its SE rewrite to look
at.

Peter.

[0] It specifically protects against strip-the-MAC/rewrite-the-message 
    attacks, but if you *can* find an attack I'd be interested in hearing 
    about it.