Dear Watson, I object to your comment about formal models of TLS not capturing wire encoding issues. miTLS does in fact formally specify the format of all messages on the wire to the bit. In fact this is complex enough that we have a full paper just about the subject that will tell you more or less everything that was said in this thread http://antoine.delignat-lavaud.fr/doc/usenix19.pdf - https://github.com/project-everest/mitls-fstar/blob/dev/src/parsers/Parsers.rfc is the formal TLS message format specification including the demonstrably unsafe constructions (implicit tags on server key exchange in 1.2 and CertificateEntry in TLS 1.3).
In the specific context of connection ID, QUIC up to draft 16 did suffer from an attack caused by the lack of encoding of the CID length. The attack is caused by the concatenation of two variable length fields in the network format (the CID and the packet number) that can both be tampered by an active attacker. The boundary of the concatenation is made ambiguous to the crypto authentication (AAD of packet content encryption) by QUIC header protection, which is applied before decryption. See https://eprint.iacr.org/2020/114.pdf (Section III.D) for a description of the attack. See https://github.com/project-everest/everquic-crypto/blob/master/src/QUIC.Spec.VarInt.fsti and https://github.com/project-everest/everquic-crypto/blob/master/src/QUIC.Spec.VarInt.fst for the formal proof that the QUIC varint encoding with minimal length representation satisfies the strong prefix property. Antoine -----Original Message----- From: TLS <[email protected]> On Behalf Of Watson Ladd Sent: dimanche 11 octobre 2020 08:50 To: Achim Kraus <[email protected]> Cc: [email protected]; [email protected]; Benjamin Kaduk <[email protected]> Subject: Re: [TLS] Fwd: Re: AD review of draft-ietf-tls-dtls-connection-id-07 On Sat, Oct 10, 2020 at 11:27 PM Achim Kraus <[email protected]> wrote: > > Hi Joe, > > > [Joe] It's unfortunate to find issues that require breaking change > at > the end of the review cycle, especially for a draft that has taken a > > long path to get here. If there is an issue that is exploitable, even > > in a corner case, someone will develop an attack, clever name, logo and > > website and we will all have to scramble to deploy a fix. It's better > > to fix now rather than later. > > Agreed, therefore I wrote at the begin of the discussion with Ben: > > >> I would prefer, if this is not changed again without strong >> > arguments! > > > In this case, I don't have a way to > exploit this issue, but > unless someone has a way to demonstrate that > this is not going to > be an issue then I believe it is prudent to fix it > now. > > > > In my opinion, ONE change may be possible. A server may be configured > to use only the old, only the new, or both by "try on the client's finish". > I'm not happy with such "dirty" work-around. I would prefer to do so > for something more the "cryptographic hygiene". > > So, if the MAC is considered to be adpated again, should it not be > discussed, why at all the cid-length should be put in? > I asked this already in January 2019 > > https://github.com/tlswg/dtls-conn-id/pull/29#discussion_r246654915 > > The MAC contains already a overall length. Even in that discussion, no > one mentioned the reason for adding it. So if there a doubts about > injection, why not remove it at all? The doubt is because of where it appears not that it appears. If every value was preceded by its length the encoding would obviously be injective. Here though it isn't clear if two different inputs to the encoding could end up the same. In fact I think in the MAC setting there almost certainly is a problem as the length of the ciphertext is right after the cid length, and with some cleverness you can come up with a cid and ciphertext that could be interpreted multiple ways. Unfortunately I haven't followed the draft's discussions that closely. I do not understand how a CID is supposed to be parsed by a recipient when the length can change and the length field is not encoded, but perhaps I'm misreading the intent of the [] notation in the record layer of the draft. > > > Would this issue have been caught by formal verification? > > That may also be something to help, not to change still again and again. I don't think the formal models of TLS reach the wire encoding. -- Astra mortemque praestare gradatim _______________________________________________ TLS mailing list [email protected] https://www.ietf.org/mailman/listinfo/tls _______________________________________________ TLS mailing list [email protected] https://www.ietf.org/mailman/listinfo/tls
