Re: [lamps] AD review of draft-ietf-lamps-cms-kemri-05

Fabian Ising <f.ising@fh-muenster.de> Mon, 30 October 2023 10:11 UTC

Return-Path: <f.ising@fh-muenster.de>
X-Original-To: spasm@ietfa.amsl.com
Delivered-To: spasm@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 41227C151539 for <spasm@ietfa.amsl.com>; Mon, 30 Oct 2023 03:11:19 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.206
X-Spam-Level:
X-Spam-Status: No, score=-4.206 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jtfuzJtfBwzr for <spasm@ietfa.amsl.com>; Mon, 30 Oct 2023 03:11:15 -0700 (PDT)
Received: from mx-out-01.fh-muenster.de (mx-out-01.fh-muenster.de [185.149.214.63]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D0D28C151087 for <spasm@ietf.org>; Mon, 30 Oct 2023 03:11:13 -0700 (PDT)
Received: from mail-director-01.fh-muenster.de (mail-director-01.fh-muenster.de [185.149.215.227]) by mx-out-01.fh-muenster.de (Postfix) with ESMTPS id 0795C200ED for <spasm@ietf.org>; Mon, 30 Oct 2023 11:10:41 +0100 (CET)
Received: from [192.168.1.9] (pd9f97439.dip0.t-ipconnect.de [217.249.116.57]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: fi545621) by mail-director-01.fh-muenster.de (Postfix) with ESMTPSA id D16A11A0064 for <spasm@ietf.org>; Mon, 30 Oct 2023 11:10:40 +0100 (CET)
Message-ID: <9ac8433c-a2c9-4070-804b-9e26e32ce5e4@fh-muenster.de>
Date: Mon, 30 Oct 2023 11:10:32 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
To: spasm@ietf.org
References: <PH1P110MB1116F6A57FF36BF7A2D8991ADCCCA@PH1P110MB1116.NAMP110.PROD.OUTLOOK.COM> <6b815a8d-7ff9-49fd-8339-418b2d7d62c1@mtg.de> <7d796f7e-3743-4691-a5bd-5d2cbb90741c@mtg.de>
From: Fabian Ising <f.ising@fh-muenster.de>
Autocrypt: addr=f.ising@fh-muenster.de; keydata= xsFNBFWMRfoBEACUiiwYj+oU/Ng36qoaVp+1EFd/33sCDgwOcm8haZ/j/sQzhIuPSiOSB2n+ dyyyoxCUfMXdjeCDsRgvA+nko6Xp1eiLNkNrpAk7tNLwwCHMbvThJ+Kf2xSlB1IVP1dkr4EV Xz7ZuBEcW25Ay2QCf/bRW+GYmGF3wpyTzdg/oK57AZx/ga81fVHI5sSQ82mWCdtd5DdZFVYS nWyF2oNN7w7Vy/y1eEJFZDVoVpfiBJKuwwulhrWrXm+XqD95hpLU+mPHH1tCzaD8cYrszc+M qrKB4i315ENV+6NbGkyUm5+xApJmgivRN7thmk0a4dXDt5wlTEEywyTlUUEaNJhUOmxY8zT8 O+TOwyprkW5H7Ewrhv4SYC55tFdHPcV+DVBRJM4wSRuIC6KYKEJQYTXTCcwtnQ3mTxelKmGm qhJ046P2FZwhV1aMwlwVar+W8DmiiJeeS4G0/L8d9MnzOp/k7JUR3aFxblSwzC1JBrigBw7v GcUIbZ1iAHlEULByjxYa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AIYNEfAZzyvSTk+63aWrFLEcbv11ApgAQUXWGEDCaVmzqfFSrtrjEV0o8tz7KtLZ5aL7J uCRXpoXVgPXUpcVSrUGlniVX5wVPUxo2csrgrXl4NG066H9pyyOKI5c9zjtB2/C4gCd9vOAc jnCzHNrI0gZ1ZzNfsB4477I0T6a3rB6csoqBuvOzTQu4Pv9eHBP0v51pDLuYGHozJzBYtk+J WjUY6cqa8o5Jg1WtwXoxm2Rt+jvdRktqpavg6GnmKgtbyozh1suAHJjf6TpmuyCsXr0MH3w=
X-Enigmail-Draft-Status: N11222
In-Reply-To: <7d796f7e-3743-4691-a5bd-5d2cbb90741c@mtg.de>
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg="sha-512"; boundary="------------ms020301050002080508030705"
Archived-At: <https://mailarchive.ietf.org/arch/msg/spasm/U1Byw4YU_rMbKZXzBH3szf8s33k>
Subject: Re: [lamps] AD review of draft-ietf-lamps-cms-kemri-05
X-BeenThere: spasm@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: This is the mail list for the LAMPS Working Group <spasm.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/spasm>, <mailto:spasm-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/spasm/>
List-Post: <mailto:spasm@ietf.org>
List-Help: <mailto:spasm-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/spasm>, <mailto:spasm-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 30 Oct 2023 10:13:23 -0000

Hello all,

Our recent paper "Content-Type: multipart/oracle - Tapping into Format 
Oracles in Email End-to-End Encryption" [1] might make this attack 
slightly more feasible. We show that in some MUAs it is possible for an 
active attacker to decrypt single (CBC) plaintext blocks by watching the 
flow pattern of TLS-encrypted IMAP communication for some clients 
*without any user interaction* (albeit with a lot of queries). If I 
understand the attack described by Falko correctly, that's exactly the 
kind of decryption oracle needed to perform this attack.

We also show an attack against a receiver (Google's hosted S/MIME 
solution) enforcing inner S/MIME signatures on incoming messages (a 
possible countermeasure discussed later in this thread) in Appendix A of 
the paper.

In general, the paper shows several techniques that might be able to 
strip or weaken requirements for user interaction from such attacks.

[1] https://www.usenix.org/system/files/usenixsecurity23-ising.pdf 
<https://www.usenix.org/system/files/usenixsecurity23-ising.pdf>

Am 27.10.23 um 10:50 schrieb Falko Strenzke:
>
> Johannes and I hereby disclose a novel AEAD-to-CBC downgrade attack 
> against state-of-the-art CMS. This is a summary of what we are 
> planning to publish in an upcoming research paper. We disclose it now 
> as we think it is likely that knowledge of this attack will help the 
> WG to understand the relevance of key separation between legacy block 
> cipher modes and AEAD modes and thus hopefully decides to incorporate 
> this measure in the KEM-RI draft.
>
>
>     Inverse CBC Decryption Oracle Attack on Low Entropy AEAD Blocks in CMS
>
> The described attack applies to the modes CCM and GCM that both use 
> CTR encryption. The attack allows to the attacker to determine the 
> content of a low entropy plaintext block in a CMS GCM or CCM (AEAD) 
> encrypted message. The preconditions for the attack are:
>
>   * The victim supports also CMS CBC decryption and reveals CBC
>     decrypted messages to the attacker. The plaintext messages that
>     victim reveals in the attack are meaningless “garbage”. This
>     assumption underlies attacks described in literature [1], [2].
>   * The attacker has sufficiently much information about one plaintext
>     block of the target AEAD ciphertext, so that the number of
>     necessary guesses (each having the size of the block cipher block
>     size) fits into such a CBC message that the victim decrypts for him.
>
> The attacks is referred to as an inverse oracle attack because it uses 
> the block decryption operation of the victim to attack the block 
> encryption operation of the original message. This implies that the 
> attack is limited to verifying guesses for low entropy blocks in the 
> target plaintext. Such attacks have, to the best of our knowledge, not 
> been described previously in the literature. Formally, this means that 
> CMS AEAD does not achieve CCA2 security in the presence of a CBC 
> decryption oracle.
>
> The attack could for instance realistically be used to reveal the 
> value of a secret code with a few digits within an otherwise known 
> message.
>
>
>       Description of the Attack
>
> In the following, let Eₖ(X) and Dₖ(X) denote the AES block encryption 
> and decryption under the key /k/ and Dₖ-CBC(Xᵢ) the AES-CBC decryption 
> under key /k/ of the plaintext block Xᵢ.
>
>   * Generate the set of /n/ guesses {Tᵢ} for /i/ ∈ {1 … /n/} for the
>     target plaintext block at position /t/ in the original AEAD
>     ciphertext. The corresponding ciphertext block in the target CTR
>     ciphertext is labelled Cₜ.
>   * Compute the corresponding set of guessed key stream blocks {Gᵢ |
>     Gᵢ = Tᵢ⊕ Cₜ for all i = 1 … /n/}
>   * Creation of the CBC ciphertext as the oracle input:
>       o choose CBC-IV as G₀ arbitrarily
>       o Form the CBC ciphertext as the sequence of the guess blocks
>         {Gᵢ | for all i = 1 … /n/}
>   * Then the CBC decryption oracle will compute the sequence of
>     plaintext blocks:
>       o {Pᵢ | Pᵢ = Dₖ-CBC(Gᵢ) = Dₖ (Gᵢ) ⊕ Gᵢ₋₁ for all i = 1 … /n/}
>   * The attacker receives the plaintext {Pᵢ} and computes
>       o {Xᵢ | Xᵢ = Pᵢ ⊕ Gᵢ₋₁ for all i = 1 … /n/}
>   * Let Hₜ be the counter block at position /t/ in the AEAD
>     ciphertext, i.e., for the correct guess of the target key stream
>     block Gᵥ at index /v/ we have Gᵥ = Eₖ(Hₜ)
>       o the counter blocks are publicly known, since GCM and CCM both
>         directly use the public nonces in the counter block
>   * Note that for the correct guess we have Xᵥ = Dₖ (Gᵥ) ⊕ Gᵥ₋₁ ⊕ Gᵥ₋₁
>     = Dₖ(Gᵥ) = Hₜ
>   * Thus, if the attacker finds for any of the {Xᵢ} that Xᵥ = Hₜ then
>       o the guess Gᵥ = Tᵥ ⊕ Cᵥ for the key stream block is correct
>       o and thus the corresponding guess Tᵥ for the plaintext block is
>         correct
>
>
>       Effect of CBC Padding Check
>
> CBC is used in CMS together with PKCS#7 padding. Thus an application 
> that enforces correct padding will make the attack more difficult. The 
> attacker has no way to enforce a correct padding or to influence the 
> length of the padding. But a correct padding of length 1 appears with 
> probability 1/256. Multi-user attacks would be one way to compensate 
> the resulting low success property of the attack.
>
> ------------------------------------------------------------------------
>
> [1] Katz, J., Schneier, B.: A Chosen Ciphertext Attack Against Several 
> E-Mail En- cryption Protocols. In: 9th USENIX Security Symposium 
> (USENIX Security 00), Denver, CO, USENIX Association (August 2000)
>
> [2] Jallad, K., Katz, J., Schneier, B.: Implementation of 
> Chosen-Ciphertext Attacks against PGP and GnuPG. In Chan, A.H., 
> Gligor, V., eds.: Information Security, Berlin, Heidelberg, Springer 
> Berlin Heidelberg (2002) 90–101
>
> Am 24.10.23 um 14:30 schrieb Falko Strenzke:
>>
>> We are aware that the document draft-ietf-lamps-cms-kemri 
>> <https://datatracker.ietf.org/doc/draft-ietf-lamps-cms-kemri/> is 
>> already in the AD review and thus far progressed in its process of 
>> finalisation. We have a good reason to propose a modification to this 
>> document still at this late stage. Both the suggested change and the 
>> reason for it are explained in the following.
>>
>>
>>       Proposed change
>>
>> We propose to include the algorithm identifier of the symmetric 
>> scheme used for the payload encryption, i.e., the 
>> contentEncryptionAlgorithm, in CMSORIforKEMOtherInfo.
>>
>>
>>       Reason for the proposed change
>>
>> The reason is, besides it generally being best practice to include 
>> such contextual information into the key deriviation, that there is 
>> the threat of AEAD-to-CBC cross-mode / downgrade attacks against 
>> state-of-the-art CMS. The KEM-RI draft has the opportunity to remove 
>> this potential weakness at least for KEMs and thus we strongly 
>> suggest to make this change. Including the contentEncryptionAlgorithm 
>> in the key derivation ensures that one arrives at different content 
>> encryption keys if the contentEncryptionAlgorithm is changed (for 
>> instance) from AEAD to CBC.
>>
>> Please note that also the OpenPGP crypto-refresh 
>> <https://datatracker.ietf.org/doc/draft-ietf-openpgp-crypto-refresh/> 
>> incorporates a key derivation – that deviates in its parameters from 
>> what we propose here and is only used in the case of AEAD – that 
>> ensures key separation for the newly introduced AEAD and the legacy 
>> CFB encrypted data packets.
>>
>> - Falko Strenzke and Johannes Roth
>>
>> Am 11.10.23 um 21:58 schrieb Roman Danyliw:
>>> Hi!
>>>
>>> I performed an AD review of draft-ietf-lamps-cms-kemri-05.  Thanks for this very important update to CMS.  This document is in good shape.  As the below are minor, I'll advance this to IETF LC and ask that this feedback be resolved concurrently.
>>>
>>> ** Section 2.  Editorial. Should the distribution of the recipient’s public key be made explicit?
>>> OLD
>>>     In advance, each recipient uses KeyGen() to create a key pair, and
>>>     then obtains a certificate [RFC5280] that includes the public key.
>>>
>>> NEW
>>>
>>> In advance, each recipient uses the KEM KeyGen() function to create a key pair, and then may obtains a certificate [RFC5280] that includes this newly generated public key.  This public key or associated certificate is them made available.
>>>
>>> ** Section 2.  Editorial.  Recommendation for several sections.  When a KEM function, KeyGen()/Encapsulate()/Decapsulate() is mentioned, referred to is as a “KEM <insert function name>”.  For example, s/Encapsulate() function/KEM Encapsulate() function/
>>>
>>> ** Section 3.
>>>        The
>>>        RecipientIdentifier provides two alternatives for specifying the
>>>        recipient's certificate [RFC5280]
>>>
>>> Isn’t the correct reference for the two mechanisms in RecipientIdentifier (i.e., issuerAndSerialNumber and subjectKeyIdentifier) provided by RFC5652?
>>>
>>> ** Section 3.  Editorial
>>>      The issuerAndSerialNumber alternative identifies the
>>>        recipient's certificate by the issuer's distinguished name and the
>>>        certificate serial number; the subjectKeyIdentifier identifies the
>>>        recipient's certificate by a key identifier.
>>>
>>> Is there a missing “or” between these two options?  Both don’t need to be present in the RecipientIdentifier structure.
>>>
>>> ** Section 3.  Process question.
>>>        Note that this requirement expands the original purpose of the ukm
>>>        described in Section 10.2.6 of [RFC5652]; it is not limited to
>>>        being used with key agreement algorithms.
>>>
>>> Does this imply that this RFC should formally “update” RFC5652?
>>>
>>> ** Section 6.1.  Since SMIME-CAPS is being used in the formal definition of the KEY-ALGORITHM class, RFC 5912 needs to be a normative reference.  RFC5912 is informational, but it already in the DOWNREF registry.
>>>
>>> ** Section 6.1. As an aside, what is the SMIME link to KEMs?
>>>
>>> ** Section 7.
>>>     The choice of the KDF SHOULD be made based on the security level
>>>     provided by the KEM.  The KDF SHOULD at least have the security level
>>>     of the KEM.
>>>
>>> What is the nuance being conveyed between these two sentences?  What additional considerations exist beyond what is spelled out in the second sentence?  This construct is repeated in the next paragraphs for key-encryption algorithms too.
>>>
>>> ** Section 7.  Typo. s/used to by the/used by the/
>>>
>>> Regards,
>>> Roman
>>> _______________________________________________
>>> Spasm mailing list
>>> Spasm@ietf.org
>>> https://www.ietf.org/mailman/listinfo/spasm
>> -- 
>>
>> *MTG AG*
>> Dr. Falko Strenzke
>> Executive System Architect
>>
>> Phone: +49 6151 8000 24
>> E-Mail: falko.strenzke@mtg.de
>> Web: mtg.de <https://www.mtg.de>
>>
>>
>> ------------------------------------------------------------------------
>>
>> MTG AG - Dolivostr. 11 - 64293 Darmstadt, Germany
>> Commercial register: HRB 8901
>> Register Court: Amtsgericht Darmstadt
>> Management Board: Jürgen Ruf (CEO), Tamer Kemeröz
>> Chairman of the Supervisory Board: Dr. Thomas Milde
>>
>> This email may contain confidential and/or privileged information. If 
>> you are not the correct recipient or have received this email in error,
>> please inform the sender immediately and delete this email. 
>> Unauthorised copying or distribution of this email is not permitted.
>>
>> Data protection information: Privacy policy 
>> <https://www.mtg.de/en/privacy-policy>
>>
>>
>> _______________________________________________
>> Spasm mailing list
>> Spasm@ietf.org
>> https://www.ietf.org/mailman/listinfo/spasm
> -- 
>
> *MTG AG*
> Dr. Falko Strenzke
> Executive System Architect
>
> Phone: +49 6151 8000 24
> E-Mail: falko.strenzke@mtg.de
> Web: mtg.de <https://www.mtg.de>
>
>
> ------------------------------------------------------------------------
>
> MTG AG - Dolivostr. 11 - 64293 Darmstadt, Germany
> Commercial register: HRB 8901
> Register Court: Amtsgericht Darmstadt
> Management Board: Jürgen Ruf (CEO), Tamer Kemeröz
> Chairman of the Supervisory Board: Dr. Thomas Milde
>
> This email may contain confidential and/or privileged information. If 
> you are not the correct recipient or have received this email in error,
> please inform the sender immediately and delete this email. 
> Unauthorised copying or distribution of this email is not permitted.
>
> Data protection information: Privacy policy 
> <https://www.mtg.de/en/privacy-policy>
>