CBOR (Concise Binary Object Representation Maintenance and Extensions)C. Bormann Internet-Draft Universität Bremen TZI Intended status: Informational 1 December 2026 Expires: 4 June 2027 CBOR Configuration draft-bormann-cbor-configuration-01 Abstract This document discusses configuration of CBOR processors. Using this information as a basis, it also provides last-call feedback on draft- ietf-cbor-serialization-13. The document might also be useful as a case study how the various layers of debt (technical, cognitive, intent [DEBT]) can interact with the standardization process, even if not exacerbated by AI use. About This Document This note is to be removed before publishing as an RFC. Status information for this document may be found at https://datatracker.ietf.org/doc/draft-bormann-cbor-configuration/. Discussion of this document takes place on the CBOR (Concise Binary Object Representation Maintenance and Extensions) Working Group mailing list (mailto:cbor@ietf.org), which is archived at https://mailarchive.ietf.org/arch/browse/cbor/. Subscribe at https://www.ietf.org/mailman/listinfo/cbor/. Source for this draft and an issue tracker can be found at https://github.com/cabo/configuration. Status of This Memo This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at https://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." Bormann Expires 4 June 2027 [Page 1] Internet-Draft CBOR Configuration December 2026 This Internet-Draft will expire on 4 June 2027. Copyright Notice Copyright (c) 2026 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/ license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 1.1. Conventions and Definitions . . . . . . . . . . . . . . . 5 2. Configuration . . . . . . . . . . . . . . . . . . . . . . . . 5 2.1. Partial Implementations . . . . . . . . . . . . . . . . . 7 2.2. Serialization Configuration . . . . . . . . . . . . . . . 9 2.2.1. Example: JSON . . . . . . . . . . . . . . . . . . . . 9 2.2.2. Example: CBOR . . . . . . . . . . . . . . . . . . . . 10 2.3. Data Model Subsetting . . . . . . . . . . . . . . . . . . 12 2.4. Normalization . . . . . . . . . . . . . . . . . . . . . . 12 3. Other WGLC Feedback . . . . . . . . . . . . . . . . . . . . . 13 3.1. "New Tag Data Model Rule" . . . . . . . . . . . . . . . . 13 3.2. CDDL Serialization Control Operator . . . . . . . . . . . 14 3.3. NaNs (Appendix B) . . . . . . . . . . . . . . . . . . . . 14 3.4. Implementation Aid (Appendix C) . . . . . . . . . . . . . 15 3.5. CDDL for Bignums (Appendix E) . . . . . . . . . . . . . . 16 3.6. Serialization Checking (Appendix G) . . . . . . . . . . . 16 3.7. Various Appendixes (F, H, I, J; K) . . . . . . . . . . . 17 3.8. Nits . . . . . . . . . . . . . . . . . . . . . . . . . . 17 4. Security Considerations . . . . . . . . . . . . . . . . . . . 19 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 19 6. References . . . . . . . . . . . . . . . . . . . . . . . . . 19 6.1. Normative References . . . . . . . . . . . . . . . . . . 19 6.2. Informative References . . . . . . . . . . . . . . . . . 20 Appendix A. LLM Feedback about "Serialization" with and without Articles . . . . . . . . . . . . . . . . . . . . . . . . 21 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 23 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 23 Bormann Expires 4 June 2027 [Page 2] Internet-Draft CBOR Configuration December 2026 1. Introduction This document discusses configuration of CBOR processors, more specifically, of libraries and other implementations that handle generation and ingestion of encoded CBOR data items for an application. Such a configuration will influence a number of individual _services_, including _serialization_ (while meeting specific _serialization constraints_), _data model subsetting_, and _normalization services_ (Section 2). Of these, only serialization/ deserialization is a core service of such a library, but that is often combined with other services for convenience and ease of implementation. | *last-call* [I-D.draft-ietf-cbor-serialization-13]: | | For convenience and easier reference to CBOR concepts, this | document includes last call comments on | [I-D.draft-ietf-cbor-serialization-13]. | | * Status: Not Ready | | - The document is difficult to appraise as it doesn’t | reveal what it actually is trying to do and how. | Reasons for a need for fundamental changes are not | identified. Lack of terminological clarity makes it | hard to predict how the document will be | (mis)understood, and thus more generally the outcome | of publishing the document. | | The introduction contains this statement: | | | Crucially, CBOR allows - and even expects - that some | | implementations will not support all serialization | | variants. JSON also permits variation (1, 1.0, and 0.1e1 | | represent the same number), but expects every parser to | | handle all of it, since the variation is there for human | | readability rather than for ease of implementation in | | constrained environments. | | (This sentence uses the word "support", which doesn't reveal | whether this is about decoder support for consuming the | specific serialization forms, or about encoder support for | meeting arbitrary partial decoder implementations' | requirements. Imprecision of this kind makes it hard to supply | straightforward fixes.) | Bormann Expires 4 June 2027 [Page 3] Internet-Draft CBOR Configuration December 2026 | It is not at all clear what the normative intent of this | statement is. This paints a picture of perpetuating a forest | of barely interoperable implementations with a thicket of | restrictions. Instead, the reality is that generic CBOR | implementations exist, and that it is much easier to build CBOR | applications based on these. The normative intent of any | contribution to the CBOR ecosystem must be to aid making this | reality more universal, instead of encouraging a world of | dominating interoperability concerns. (Partial implementations | have their place, see below, but should not be the usual | situation an application developer is by default confronted | with.) | | Since another revision of | [I-D.draft-ietf-cbor-serialization-13] is likely to be needed, | this review does not yet attempt detailed checking of the | examples. | | *last-call* [I-D.draft-ietf-cbor-serialization-13]: | | This review does not provide detailed editorial comments. | Rohan Mahy has provided a proposal (Archived-At: | https://mailarchive.ietf.org/arch/msg/cbor/-JjwxPA6LocJzVQb3Mb- | w8f3y74 (https://mailarchive.ietf.org/arch/msg/cbor/- | JjwxPA6LocJzVQb3Mb-w8f3y74)) to focus the document on its | Sections 4, 5, and 7, and remove supplementary material such as | Apendices H, I, and J; Appendix C is questioned as well (see | also Section 3.4). Performing a cleanup might make the | document more accessible and provide an opportunity to focus on | statements that have consensus. | | *last-call* [I-D.draft-ietf-cbor-serialization-13]: | | One constant source of confusion is the choice of the word | "use" for various forms of making use of the constraints | defined in a serialization configuration; | https://mailarchive.ietf.org/arch/msg/cbor/ | jp_Ig2Dd3-hWfwB9Pt_jHBJIxNQ | (https://mailarchive.ietf.org/arch/msg/cbor/ | jp_Ig2Dd3-hWfwB9Pt_jHBJIxNQ) points out right at the start that | the document "needs to be a lot more clear about the difference | between encoding in a given serialization and erroring on | decode when an expected serialization is not found." and then | goes on giving a number of instructions on how to achieve more | clarity. Bormann Expires 4 June 2027 [Page 4] Internet-Draft CBOR Configuration December 2026 1.1. Conventions and Definitions For brevity, this revision of this document uses the definitions of RFC 8949 [STD94] and of Section 1.2 of [CDE]. Please do consult these definitions while reading the present document. Additional Terms: Service: A potential function of a CBOR processor implementation. This includes services that are combined with the core services provided by that implementation, for convenience and ease of implementation. Partial implementation enabler (PIE): An agreement between producers and consumers of data items used in a CBOR-based protocol that allows for partial implementations on the consumer side. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here. 2. Configuration A CBOR application often makes use of a _CBOR library_ (more generally speaking, _CBOR implementation_) to perform certain services. There may be a need to communicate preferences or instructions from the CBOR application to the CBOR library on how to perform the services; this document uses the term "configuration" in this specific sense. Some parameters of a configuration mechanism provided may be entirely _local_, such as memory allocation parameters. Some may be _unilateral_, i.e., they influence the generated CBOR, but the consuming application does not need to agree to these influences. Some may be _interoperability constraints_, i.e., certain parameters need to be known on both the producing and the consuming side. * _Serialization constraints_ restrict the serialization variants available for CBOR data items. - This may be motivated by enabling a partial implementation on the consumer side which has to deal with fewer variants. Bormann Expires 4 June 2027 [Page 5] Internet-Draft CBOR Configuration December 2026 - In the area of serialization, the CBOR application may want to make use of _deterministic serialization_, which needs to be explicitly configured on the producer side and usually (depending on application requirements) also on the consumer side. * _Data model subsetting_ may be a service requested by an application that does not need to handle certain CBOR data items. For instance, a CBOR application may not need to handle floating point values. This can enable compiling the library used with special flags to save the code space that would be needed (partial implementation enabler). Data model subsetting on the consumer side typically is an interoperability constraint (certain values can no longer be interchanged). * _Normalization services_ may be provided by a CBOR library as a service that offloads some application code into the library, e.g., if the application desires to have all text strings sent in a Unicode Normalization Form (such as NFC). In certain cases, normalization services may be performed at the consuming side before ingested CBOR is handed to the application; this needs to be handled with caution as the application no longer sees what was actually interchanged. | *last-call* [I-D.draft-ietf-cbor-serialization-13]: | | The draft in WGLC does not make this distinction, calling the | entire set of configuration information "a serialization". | This can be very confusing, e.g., in the abstract, where the | text announces the draft will define new "serializations", when | in reality it is fortunately entirely based on the encodings | (serializations) defined by [STD94]. The muddiness of these | terms also causes unnecessary verbosity, e.g., in Section 4.2 | of [I-D.draft-ietf-cbor-serialization-13], where each bullet | point about serialization constraints apparently needs to be | prefixed by a condition such as "If floating-point numbers are | encoded", which is about data model subsetting and not about | serialization variation. | | Generally, not clearly distinguishing "serialization" (the | process) from a particular sequence of bytes used to encode a | CBOR data item ("a serialization", with an article) leads to | highly misleading statements such as | Bormann Expires 4 June 2027 [Page 6] Internet-Draft CBOR Configuration December 2026 | 1.4. Relation to RFC 8949 | | 1.4.1. Serialization | | This document defines new serializations rather than updating those | in [RFC8949]. [...] | | (Section 1.4.1 of [I-D.draft-ietf-cbor-serialization-13]); | please see Appendix A for some examination of how such a | statement will be read. In reality, | [I-D.draft-ietf-cbor-serialization-13] defines configurations | that _choose_ among the serializations that [STD94] defines; | there are no new serializations (encodings) being proposed in | [I-D.draft-ietf-cbor-serialization-13] (and that is a good | thing). 2.1. Partial Implementations CBOR has been designed to be useful in constrained environments. It therefore embraces _partial implementations_, i.e., implementations that do not provide access to all the features of the CBOR representation format. Partial implementations often have interoperability considerations: They can only be used for CBOR-based protocols that do not exercise features that have been left out (for instance, a constrained implementation that does not provide floating point values cannot be used for high-resolution timestamps based on CBOR Tag 1). To a certain extent, CBOR-based protocols can accommodate partial implementations: A protocol that uses Tag 1 could restrict the tag content to an integer, enabling the use of partial implementations without floating point support. While CBOR does embrace partial implementations in this way, this does not mean a receiving CBOR protocol implementation is free to leave out features and expect the CBOR generator to magically know that this will be the case and implement workarounds. Instead, the use of a partial implementation needs to be _enabled_; the present document speaks about _partial implementation enablers_. While there is an infinite number of implementation omissions that could be made in a CBOR implementation, certain omissions are widely employed and therefore may be worth to be explicitly called out, assigning them a name. This facilitates using these names in the definition of a CBOR-based protocol and in the configuration interface of a CBOR generator. Bormann Expires 4 June 2027 [Page 7] Internet-Draft CBOR Configuration December 2026 Some of these are about serialization configuration, see Section 2.2; this leads to a small number of easy-to-implement and widely considered useful partial implementation enablers such as "definite- length only" (DLO) or "no integer overlap" (NIO). Some of these are about data model subsetting (e.g., no floating point), which actually have implications on the application data model and are therefore much more numerous, but also don't _need_ library support (can be left to the control of the application). | *last-call* [I-D.draft-ietf-cbor-serialization-13]: | | The text of [I-D.draft-ietf-cbor-serialization-13] is somewhat | confused about what CBOR "allows" to be omitted from a decoder | implementation: | | | Crucially, CBOR allows — and even expects — that some | | implementations will not support all serialization | | variants. JSON also permits variation (1, 1.0, and 0.1e1 | | represent the same number), but expects every parser to | | handle all of it, since the variation is there for human | | readability rather than for ease of implementation in | | constrained environments. | | CBOR and JSON both define formats; implementations may choose | to only partially implement the format and thus be less useful | but maybe easier to implement and less wasteful of resources. | JSON permits many variant encodings of the same data because | that actually is easier to implement than adding arbitrary | restrictions to a quite concise format definition, only blank | space (which CBOR as a binary format doesn't have) is entirely | focused on aiding human readability. CBOR has learned from the | successes of this approach, but its design also is aware of the | severe implementation constraints posed by some low-resource | systems. Saying that this automatically allows a decoder to be | a partial implementation implies that the onus is on the | encoder to somehow be aware of what has been implemented — | clearly that was not the intent of the discussion in [STD94], | which is unambiguous on what is part of the format. | (Obviously, an application protocol may engage in data model | subsetting (see also Section 2.3 of the present document) and | make the job of encoder and decoder easier if that is defined | as part of the protocol.) | | Thorough support for partial implementations needs to be aware | of what omissions actually do reduce the resources needed by | the decoder; only a small number of such omissions should be | defined if needed to aid low-resource implementations if the Bormann Expires 4 June 2027 [Page 8] Internet-Draft CBOR Configuration December 2026 | application protocol can be defined to specifically "allow" | these omissions. One popular example is "definite-length only" | (DLO), as this constraint can simplify memory management in a | decoder that mainly deals with in-memory data. 2.2. Serialization Configuration 2.2.1. Example: JSON For a given [JSON] value, there are often a large number of JSON texts that could be used to serialize it. For instance: * The number format provides significant serialization variation, e.g., (in the [I-JSON] interpretation) the number 42 can be serialized in an infinite number of ways, as 42, 42.0, 42.00, 42.0000000 (adding trailing insignificant zeros), 42e0, 4.2e1, .42e2, 420e-1 (using exponents in various ways), 42e00, 4.2e01, 4.2e+1, 4.2e+01 (adding sign characters and/or insignificant zeros to an exponent), etc. * Each character in a text string may provide a choice between directly including that character in the JSON text and using a \uNNNN or \uHHHH\uLLLL escape; the / character can also be escaped as \/. * The serialization of containers (arrays and JSON objects (maps)) provide for the insertion of blank space between elements/entries. Blank space can also be added outside (before or after) a serialized JSON value to make a JSON text. 2.2.1.1. JSON Implementations: Serialization Controls There are probably a few hundred "serious", open-source general- purpose JSON implementations. These rarely provide controls that choose specific serialization variants, beyond those that relate to human consumption of the serialized JSON text (i.e., pretty printing). With luck, there may be a control for the text string escaping choosing between direct representation of all Unicode characters where JSON allows this vs. an "ASCII-only" mode escaping non-ASCII characters. Bormann Expires 4 June 2027 [Page 9] Internet-Draft CBOR Configuration December 2026 2.2.1.2. JSON Deterministic Serialization A specification for deterministic serialization of JSON data exists [JCS]. This is usually not implemented as a serialization option by general JSON implementations, but by specially made JCS implementations (of which there probably are a couple of dozen "serious", open-source ones in existence). For example, the implementation of JCS number formatting is generally considered highly error-prone. 2.2.2. Example: CBOR For a given CBOR data item, there are often multiple encoded CBOR data items ("encodings") that can be used to serialize it. Deterministic serializations reduce this number to exactly one variant. In contrast to JSON, CBOR explicitly embraces _partial implementations_ of the CBOR data format. A partial implementation at a producer may involve data model subsetting in the CBOR library; unless that data model subsetting is part of the application data model, this may mean limitations to the expressiveness that the producer can make use of. As it is part of the library configuration it hands down, the producer application will be aware of this subsetting and can implement strategies for dealing with this subsetting (e.g., the application might round tag 1 timestamp values to the nearest integer if the additional resolution provided by floating point values is not needed). If data model subsetting is to enable the consumer to use a partial implementation, the producer needs to be aware of this; this then becomes an interoperability constraint. This document speaks about a _Partial implementation enabler_ (PIE): An agreement between producers and consumers of data items as defined in a CBOR-based protocol that allows for partial implementations on the consumer side. A PIE may place additional onus on the producer side, including the application (e.g., converting all timestamps to integer in order to avoid the interchange of floating point numbers), and/or reduced onus (no need to encode floating point numbers if they are not used in the data model). 2.2.2.1. CBOR Implementations: Serialization Controls Handling interoperability in an ecosystem that embraces partial implementations requires more discipline. Bormann Expires 4 June 2027 [Page 10] Internet-Draft CBOR Configuration December 2026 | *last-call* [I-D.draft-ietf-cbor-serialization-13]: | | In particular, it is necessary to distinguish omissions that | just place an onus on the producer (e.g., providing an | efficient serialization variant), potentially unilaterally, | from those that transfer an onus from the consumer to the | producer (which needs to know that there is now some expected | behavior). Some rules concern the applications (data model | subsetting plus possibly normalization procedures that | facilitate that subsetting), some don't (serialization | variants, except for the special case of deterministic | encoding). 2.2.2.2. Deterministic Serialization for CBOR Deterministic serialization is generally easy to achieve in CBOR and in many cases can be based on a generic implementation (encoder/ decoder). There are several different (completed and draft) specifications for deterministic serialization: * A common format specified in Section 4.2.2 of RFC 8949 [STD94]. * A legacy specification in Section 4.2.3 of RFC 8949 [STD94], compatible to a previous specification Section 3.9 of [RFC7049] (called "Canonical CBOR" there). (Common and legacy deterministic serialization differ in the ordering of maps.) * [CBOR-42], a "bespoke serialization of CBOR intended for use with the special tag 42 in various end-to-end protocols that came out of the IPFS community". | *last-call* [I-D.draft-ietf-cbor-serialization-13]: | | [I-D.draft-ietf-cbor-serialization-13]'s "Deterministic | Serialization" adds a variation of the common format, restating | it based on Section 4.2.2 of RFC 8949 [STD94]. This adds risk | that this restatement is not identical to the standard | ([RESTATEMENT]). In addition, | [I-D.draft-ietf-cbor-serialization-13] deviates willfully by | defining "Deterministic Serialization" as a configuration that | entangles this serialization specification with some unrelated | data model subsetting. Map sorting obviously requires additional effort in an encoder. Allowing to expect maps to be sorted can help with taking an onus off the consumer: Needing to be able to process the map entries in any order can take more code/be less efficient for the consumer than knowing what order they will arrive in. (The latter does require Bormann Expires 4 June 2027 [Page 11] Internet-Draft CBOR Configuration December 2026 making the order available to the application processing.) (CoAP Option processing is an example for how knowing the order in which entries arrive can be quite beneficial for a constrained implementation.) 2.3. Data Model Subsetting The CBOR library may be made aware that certain parts of the CBOR generic data model are not used in the application data model of a CBOR application, possibly leading to a reusable subset of the generic data model. In this case, the producer may want to do a poor form of data model validation, and the consumer may do the same or simply reject input that doesn't respect the data model subset. The producer also may want to offer a normalization service (Section 2.4), possibly in support of data model subsetting. A typical example is a constrained implementation for a platform that doesn't provide a platform type for floating point numbers, or maybe only for float32 and not float64. In the latter case, a normalization service could round float64 numbers to a close float32 number. Whether that is acceptable for the application needs to be defined by the CBOR-based protocol. A disadvantage of performing data model subsetting in the CBOR library is that, unless there is detail information supplied by some data definition (e.g., an extension to CDDL), it applies equally whole-sale to the entire CBOR data item. Data model subsetting can be a partial implementation enabler (PIE); a bespoke CBOR consumer does not need to implement parts of the CBOR functionality that are not in the protocol's data model subset. 2.4. Normalization Normalization services may be a convenient addition to a CBOR library. For example, an application protocol that requires text strings to be in some Unicode normalization form (in many cases where this is needed, that will today be NFC) may want to flip a bit in the encoder configuration instead of doing the processing in the application implementation. Similarly, an application protocol that needs NaNs as a distinct data type but only one NaN value may want the encoder to normalize all NaN values to the chosen one. Normalization is visible at the application layer; users of CBOR libraries need to be aware of which normalization processes are enabled in the library. The CBOR-based protocol usually does not know (or care) whether the normalized values came from the application or from a normalization service in a library. Bormann Expires 4 June 2027 [Page 12] Internet-Draft CBOR Configuration December 2026 As with data model subsetting, a disadvantage of performing normalization in the CBOR library is that, unless it is controlled by some data definition (e.g., an extension to CDDL), it applies whole- sale to the entire CBOR data item. On the other hand, normalization will typically not reach into the internals of CBOR data items, in which case embedded CBOR or homogeneous tagged arrays might not be covered. 3. Other WGLC Feedback 3.1. "New Tag Data Model Rule" | *last-call* [I-D.draft-ietf-cbor-serialization-13]: | | Section 7 of [I-D.draft-ietf-cbor-serialization-13] attempts to | reflect a valid concern that has been brought to light in the | WG's discussion of the special role of CBOR tag 2/3. The | section needs to be more specific in what way new tags may not | "affect" existing data types of CBOR. (Does tag 25 "affect" | strings? Some relevant discussion about serialization aspects | also in Section 11.2.3 of [I-D.bormann-cbor-notable-tags].) | | The observation identified here is that tag 2/3 can be used not | only to serialize data items not in the basic generic data | model (i.e., outside the space already covered by mt0/1), but | can also be used as an alternative serialization of existing | integer data items that also can be expressed as mt0/1. This | can be called the "integer overlap". | | Supporting the integer overlap in CBOR was a deliberate | decision, enabling e.g. a more efficient representation of | 40-bit integers; more generally it is part of the strategy of | CBOR to work well with no longer than 64-bit arguments (i.e., | "ai" values from 28 to 30 are not used). It does have | consequences on how a generic decoder needs to work. (This | makes decoding tag 2/3 a requirement for generic decoders, even | if the application data model does not contain integers outside | mt0/1.) In short, while acceptable for the legacy case of | integers, implementing such an overlap for a new tag would | require more effort than the WG found acceptable for | definitions of new tags. | | For certain applications, a "no integer overlap" PIE for the | tag 2/3 case is useful. (No integer overlap is also implied by | Preferred Serialization, see Section 4.2.1 of RFC 8949 | [STD94].) Beyond that, it is not so easy and will be time- | consuming to formulate an exact rule for what a new tag is | allowed or is not allowed to do; the important contribution Bormann Expires 4 June 2027 [Page 13] Internet-Draft CBOR Configuration December 2026 | here might be writing up the problem and giving the protocol | designer (and later the Designated Expert) enough information | to diagnose whether the concern would apply to a new tag. 3.2. CDDL Serialization Control Operator | *last-call* [I-D.draft-ietf-cbor-serialization-13]: | | | // Note: There is a new PR 110 that would remove Section 8 of | // [I-D.draft-ietf-cbor-serialization-13]: https://github.com/ | cbor- | // wg/draft-ietf-cbor-serialization/pull/110 | (https://github.com/ | // cbor-wg/draft-ietf-cbor-serialization/pull/110) . So the | present | // discussion may be no longer relevant. | | The new ".serial" CDDL control operator introduced in Section 8 | of [I-D.draft-ietf-cbor-serialization-13] is only sketched. | The CDDL processing model does not provide for controlling | serialization. Functionality like this can be added to CDDL by | extending its processing model, but generally requires more | careful considerations. Questions such as how nested | applications of the operators combine have already come up on | the mailing list. | | Not setting up a registry for the names that can appear at the | controller appears to try to limit the kinds of serialization | constraints that can be expressed. | | Given that there are several deterministic serializations in | use, as well as a number of partial implementation enablers | identified, this is not going to address a sufficient part of | reality. | | The solution definitely should make it easy to do the right | thing. It should not try to make it impossible or very hard to | express not doing a green-field design where a different | deterministic encoding is already deployed. 3.3. NaNs (Appendix B) | *last-call* [I-D.draft-ietf-cbor-serialization-13]: | | (The author of this review has not fact-checked this appendix | in detail as it is mostly not needed as explained below.) | Bormann Expires 4 June 2027 [Page 14] Internet-Draft CBOR Configuration December 2026 | The technical arguments are well known, they will not be | repeated here. | | What is maybe less obvious is what role CBOR plays in this. | | There actually is no requirement that CBOR has to heal all of | IEEE 754's shortcomings in this space before it can make | floating point values available for interchange. | | CBOR's data model calls for serializations in binary64, and, | for preferred serializations, in binary32 and binary16. | | For platforms that already support IEEE 754, it is usually | trivial to obtain a binary64 that is ready for interchange. | (Certain legacy platforms such as PA-RISC and pre-R6 MIPS may | have an additional step, but that is well-known for those | platforms.) | | The small piece of work a CBOR implementation has to do here | (if it wants to support common deterministic encoding) is | narrowing these values to binary32 and binary16 where that is | possible. [STD94] defines exactly how this is to be done, for | the purposes of CBOR. Appendix F of [CDE] shows one way how to | do this, which was example code sorely missing from previous | documents about CBOR. Since most modern CPUs have instructions | for doing this work (to which CBOR is compatible by design), | there may be an even simpler way to do this. | | The WG may not have a lot of interest in financial or | instrumentation applications of CBOR. This does not mean we | should simply steamroll over them by trying to create a world | where NaNs are actively ostracized. | | (Trying to entangle the intended mostly-removal of NaNs with | the serialization constraints proposed also creates unnecessary | conflicts, where one of the two may be desired but not the | other.) 3.4. Implementation Aid (Appendix C) | *last-call* [I-D.draft-ietf-cbor-serialization-13]: | | Appendix C contains a reformulated and extended form of | Appendix F of [CDE]. This is great, even if the added bulk may | be matter of taste. | Bormann Expires 4 June 2027 [Page 15] Internet-Draft CBOR Configuration December 2026 | It is a bit suspect why the reformulated code no longer covers | all of CBOR. In the process of amputating the (zero-LOC) | solution for that, the code also became questionable. | | The code that may be using the example code was not shown, but | in a likely implementation, the effect is that a NaN that is | different from the chosen one will be serialized as binary64, | which is not what [STD94] says. The commentary at the start of | the code actually now says: | | -2 indicates a non-trivial NaN | was given for encoding which should either be rejected or output as a | half-precision quiet NaN. | | ...which is an invitation to perform normalization (towards a | chosen NaN) behind the back of the application. 3.5. CDDL for Bignums (Appendix E) | Appendix E of [I-D.draft-ietf-cbor-serialization-13] is quite | confused about the use of CDDL in the presence of serialization | variants. Since CDDL does not process serialization, the | omission stated at the start of the appendix does not exist. | | Some CDDL is provided, which looks like it is trying to express | a desired data model subsetting, in terms of serialization | details. CDDL does provide limited ways to express such a data | model subsetting (see [useful] for a collection of snippets), | but limiting an integer to -2**8000..2**8000-1 Or maybe the | author didn't know about the control operator .gt? | | Please delete this Appendix. 3.6. Serialization Checking (Appendix G) | *last-call* [I-D.draft-ietf-cbor-serialization-13]: | | The kind of checking that is being discussed here makes a lot | of sense (actually, is usually required) for a deterministic | encoding, where it also has a trivial definition. | | For anything else, there is very little reason to perform this | kind of checking (outside of diagnostic implementations). | Requiring this checking for anything else in a CBOR-based | protocol would dramatically reduce the selection of CBOR | decoders that can be used. The damage caused to the CBOR | ecosystem unfortunately will not be limited to the CBOR-based | protocol; we should not encourage that. Bormann Expires 4 June 2027 [Page 16] Internet-Draft CBOR Configuration December 2026 3.7. Various Appendixes (F, H, I, J; K) | *last-call* [I-D.draft-ietf-cbor-serialization-13]: | | Appendix F appears to make some questionable recommendations. | | When a CBOR library provides a bignum API, values that fall within | the range of major types 0 and 1 must be encoded using those major | types rather than tags 2 or 3. | | That is true for deterministic encoding, but not in general. | What this text is really trying to say is that there is no | connection between the encoding variant used and the platform | type chosen. This principle probably should be explained much | earlier, because it is not specific to bignums or tag2/3 APIs. | | The last paragraph also suffers from not clearly distinguishing | between platform or application type ranges and the choice | between mt0/1 and tag 2/3. A good description of the | interaction between these two would deserve more thinking. | | *last-call* [I-D.draft-ietf-cbor-serialization-13]: | | Similarly, Appendices H, I, and J, contain interesting material | for discussion that unfortunately would need to actually be | worked through. Right now, this seems to be useful material | for a Wiki. | | Appendix K shows a number of test cases that could be useful | but are harder to read than necessary by not using blank space | in the formatting of the hex literals. 3.8. Nits | *last-call* [I-D.draft-ietf-cbor-serialization-13]: | | * Confusing statements about COSE | | | It is also RECOMMENDED that CBOR libraries support | | deterministic serialization, as some protocols (for | | example, COSE) require it. | | | For such a design to function correctly, the framework | | protocol must require deterministic serialization, | | possibly only for a subset of the protocol. COSE is an | | example, elaborated upon in Appendix J. | Bormann Expires 4 June 2027 [Page 17] Internet-Draft CBOR Configuration December 2026 | While these statements about COSE technically are true, what | COSE needs is a rather limited form of _producer_ support for | COSE's deterministic encoding, to enable creating signing input | only. The input to that is defined on a data model subset that | does not include maps with more than one entry (actually, no | maps at all). This makes COSE compatible with both CDE and | LDE. COSE does not use deterministic encoding for anything | exchanged over the wire. The text looks like it is saying | that, and it certainly will be misinterpreted and misquoted. | | * Terms Subset/Superset | | | another. Since deterministic serialization is a subset | | of preferred- plus, wherever both apply the effective | | requirement is deterministic, regardless of which one is | | outermost. | | Deterministic serialization requirements are a superset | of those for preferred-plus; a CBOR library that | implements only deterministic serialization therefore | satisfies the recommendation for preferred- plus | serialization. | | Most of the configuration options discussed in the present | document are about requiring _subsetting_ the set of choices. | Combining requirements can also be perceived as creating a | _superset_ of requirements. These interpretations with an | opposing sense are probably best avoided unless accompanied by | text that makes clear which kind subset/superset is being | discussed. | | There are related sentences such as (5.1): | | | All of preferred-plus serialization defined in | | Section 4.1 MUST be used. | | This probably does not mean that all of preferred-plus needs to | be exercised, but that all requirements stated must be | fulfilled. (The unease some of us feel about "plus" is another | manifestation of this ambiguity; preferred-definite would be a | better name.) | | * Term "Preserve" | | | A CBOR library is not required to preserve the order of | | keys when decoding a map, | Bormann Expires 4 June 2027 [Page 18] Internet-Draft CBOR Configuration December 2026 | The point here appears to be that there is no need for the CBOR | application to be informed about the order of the entries in | the map. Whether that would be trivial ("preserve") or hard to | do (e.g., if the platform only has an unordered map) depends on | the platform. 4. Security Considerations TODO configuration security | *last-call* [I-D.draft-ietf-cbor-serialization-13]: | | The security considerations of | [I-D.draft-ietf-cbor-serialization-13] only seem to be | concerned with exploiting serialization variation as a covert | channel (between the CBOR encoder and a third party?), | Section 9.1 of [I-D.draft-ietf-cbor-serialization-13]. This is | somewhat surprising, as JSON and a lot of other IETF | specifications have exactly the same considerations, which are | rarely discussed. More generally, if the document wants to | focus on this subject, it should provide context on how this is | a general problem of a wide selection of protocols, and | probably reference research such as | [DOI.10.1109_MNET.2024.3352411]. | | One solution that is suggested in the text is "to require | preferred-plus or deterministic serialization". A CBOR-based | protocol that requires a deterministic serialization indeed | reduces the attack surface. However, preferred-plus | serialization should not be listed as a solution: it provides a | false sense of security unless map ordering also is | deterministic; only the agreement on actual deterministic | encoding provides at least some protection in a checking | decoder. (Data model subsetting can be combined with | preferred-plus, limiting any maps encoded to zero or one | entries, to achieve a specialized variant of deterministic | encoding. It is not really clear why a somewhat risky | combination of configuration settings are acceptable here when | explicitly identifying the encoding as deterministic would be | straightforward instead.) 5. IANA Considerations This document has no IANA actions. 6. References 6.1. Normative References Bormann Expires 4 June 2027 [Page 19] Internet-Draft CBOR Configuration December 2026 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, . [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017, . 6.2. Informative References [CBOR-42] Bumblefudge and R. Berjon, "The tag-42 profile of CBOR", Work in Progress, Internet-Draft, draft-caballero-cbor- cbor42-02, 17 March 2026, . *FIX ME*: https://github.com/ietf-tools/bibxml-service/issues/458 [CDE] Bormann, C., "CBOR Common Deterministic Encoding (CDE)", Work in Progress, Internet-Draft, draft-ietf-cbor-cde-13, 13 October 2025, . [DEBT] Storey, M., "From Technical Debt to Cognitive and Intent Debt", Association for Computing Machinery (ACM), Queue vol. 24, no. 2, DOI 10.1145/3807966, March 2026, . [DOI.10.1109_MNET.2024.3352411] Caviglione, L. and W. Mazurczyk, "You Can’t Do That on Protocols Anymore: Analysis of Covert Channels in IETF Standards", Institute of Electrical and Electronics Engineers (IEEE), IEEE Network vol. 38, no. 5, pp. 255-263, DOI 10.1109/mnet.2024.3352411, September 2024, . [I-D.bormann-cbor-notable-tags] Bormann, C., "Notable CBOR Tags", Work in Progress, Internet-Draft, draft-bormann-cbor-notable-tags-17, 29 August 2026, . [I-D.draft-ietf-cbor-serialization-13] Lundblade, L., "CBOR Serialization and Determinism", Work in Progress, Internet-Draft, draft-ietf-cbor- serialization-13, 15 November 2026, . Bormann Expires 4 June 2027 [Page 20] Internet-Draft CBOR Configuration December 2026 [I-JSON] Bray, T., Ed., "The I-JSON Message Format", RFC 7493, DOI 10.17487/RFC7493, March 2015, . [JCS] Rundgren, A., Jordan, B., and S. Erdtman, "JSON Canonicalization Scheme (JCS)", RFC 8785, DOI 10.17487/RFC8785, June 2020, . [JSON] Internet Standard 90, . At the time of writing, this STD comprises the following: Bray, T., Ed., "The JavaScript Object Notation (JSON) Data Interchange Format", STD 90, RFC 8259, DOI 10.17487/RFC8259, December 2017, . [RESTATEMENT] Bormann, C., "The Restatement Anti-Pattern", Work in Progress, Internet-Draft, draft-bormann-restatement-06, 31 August 2026, . [RFC7049] Bormann, C. and P. Hoffman, "Concise Binary Object Representation (CBOR)", RFC 7049, DOI 10.17487/RFC7049, October 2013, . Obsoleted by [STD94], cited here for historical interest in legacy Section 3.9 "Canonical CBOR" [STD94] Internet Standard 94, . At the time of writing, this STD comprises the following: Bormann, C. and P. Hoffman, "Concise Binary Object Representation (CBOR)", STD 94, RFC 8949, DOI 10.17487/RFC8949, December 2020, . [useful] "Useful CDDL", n.d., . Appendix A. LLM Feedback about "Serialization" with and without Articles | *last-call* [I-D.draft-ietf-cbor-serialization-13]: | Bormann Expires 4 June 2027 [Page 21] Internet-Draft CBOR Configuration December 2026 | In the discussion about terminology, a statement was made that | "serialization" always is about the process and never about the | result, so the usage in [I-D.draft-ietf-cbor-serialization-13] | was assumed to be unambiguous. Since LLMs are usually quite | good in understanding the common use of a term, the author | asked one LLM a question, which received the result below: | | _»For a computer science person, what is the difference in | meaning between "Serialization" (no article) and "A | serialization" (definite article)?«_ | | | “Serialization” is the general process; “a serialization” | | is one particular serialized form. In computer science, | | *serialization* (no article) usually refers to the | | concept or process of converting an in-memory object or | | data structure into a linear, storable/transmittable | | representation. For example: “Serialization lets us send | | objects over the network.” | | | | By contrast, *a serialization* (with an article) usually | | points to a specific serialized instance or specific | | scheme. For example: | | | | * “We store *a serialization* of the tree on disk” → one | | concrete byte sequence or file. | | | | * “This is *a serialization* of the graph using JSON” → | | one particular encoding of that data. | | | | * “Protocol Buffers define *a serialization* for | | messages” → one particular format/representation, as | | opposed to some other possible format. | | | | So: | | | | * “Serialization” = the general technique or operation. | | | | * “A serialization” = one concrete representation (or | | one particular encoding style) produced by that | | technique. | | The LLM's examples maybe weren't quite consistent in the end, | but this answer should suffice to substantiate the observation | that sharper terminology is needed. Bormann Expires 4 June 2027 [Page 22] Internet-Draft CBOR Configuration December 2026 Acknowledgments TODO acknowledge. Author's Address Carsten Bormann Universität Bremen TZI Postfach 330440 D-28359 Bremen Germany Phone: +49-421-218-63921 Email: cabo@tzi.org Bormann Expires 4 June 2027 [Page 23]