On 15. Oct 2023, at 18:10, Denis <denis.i...@free.fr> wrote: > > Hi Brian and Orie, > > In the "old days", such problem did not existed. The prime example is using > ASN.1 / DER where the decoder can first know the full size of the message > using two or more bytes after the first byte that must contain the value 30 > (SEQUENCE). Then after, the server was knowing which ASN.1 sequence to > receive > and the decoder was able to check whether the whole sequence was or was not > conformant to an ASN.1 description identified using an OID.
The nested embedded lengths in BER/DER could be wonderfully exploited by attackers by making them inconsistent with each other; they were a prime reason that there were so many CVEs in the ASN.1 space. Modern representation formats usually do not repeat this mistake. (If selective skipping is really important, CBOR enables that by using “embedded CBOR”.) > So the whole sequence could be decoded safely without the need to check or > not that the sequence was correctly signed. There seems to be an assumption in this discussion that an attacker somehow can’t produce valid signatures. *Some* bugs in the representation format implementation may be harder to exploit with such a requirement, but it is not a panacea. > While it is well known that a JSON object only need a parser to be decoded > and not also a schema, using a schema with a parser might be a solution to > consider, > but I fear this is opening a can of worms. > > Outside of the IETF, the use of schemas for JSON has been considered. There > may be good reasons why the IETF has not considered such a possibility, > but I don't know these reasons. IETF has two data definition languages to choose from: YANG and CDDL. Both can describe data models that can be represented in CBOR or JSON. I would expect us to use one of them, just as I’d expect ABNF to be used for text-based formats. Grüße, Carsten _______________________________________________ OAuth mailing list OAuth@ietf.org https://www.ietf.org/mailman/listinfo/oauth