4 ms·
Fine that they didn't another insecurity as in the latest updates. JSON is still the only secure transportation protocol if you don't use the RFC 9159 simplific
by rurban 9y ago
Fine that they didn't another insecurity as in the latest updates. JSON is still the only secure transportation protocol if you don't use the RFC 9159 simplification, http://search.cpan.org/~mlehmann/JSON-XS-3.02/XS.pm#SECURITY_CONSIDERATIONS http://search.cpan.org/~mlehmann/JSON-XS-3.02/XS.pm#SECURITY...
- viraptor 9y agoWhat do you mean by "only secure transportation protocol"? There's nothing inherently insecure in XML, yaml, asn1, bson, cbor, msgpack, out whatever other popular format. Implementations may fail, but that's a different problem.
- masklinn 9y ago* YAML is pretty much inherently insecure, custom tags are part of the YAML spec and are interpreted by default by most implementations, the YAML 1.2 spec only recommends defaulting to the "core" schemaor a lesser one and (AFAIK) at no point even suggests disabling explicit tags. * XML is most definitely inherently insecure if you don't disable or strictly limit standard features (entity definition/expansion, external entity definition, DTD retrieval). I don't know about the others, I do know that ASN.1 has a long and storied history of vulnerable implementations (and it's unclear whether there's ever been a secure one) which tells me that even if the format is not inherently insecure, in practical terms it is.
- viraptor 9y agoBoth cases make good, secure implementations harder. They don't make the protocol itself insecure since you can make implementations that avoid these issues. There's nothing in the protocol itself that forces you into a situation of "choose between valid or secure".
- masklinn 9y ago> Both cases make good, secure implementations harder. You literally can't secure XML without refusing to enable (or implement) standard features.
- viraptor 9y agoAre external entities required to be processed? I know multiple implementations require you to opt-in to download anything, so I don't think so. But happy to be corrected.
- jnwatson 9y agoASN.1's main issue is that it was created in the 80's, so most implementations were programmed before folks understood software security. Also, it has had almost 40 years of additions, so it is now a large spec.
- cryptonector 9y agoASN.1's main issue is that BER/DER/CER are awful, and they are awful because they are TLV (tag, length, value) encoding rules. ASN.1 itself is a bit clunky, but has everything you'll ever need. Too many people have reinvented ASN.1 badly. Protocol Buffers, I'm looking at you!
- rurban 9y agoOf those you cited only msgpack is besides JSON inherently secure. All others are insecure by default. Read the link I cited. BTW The latest 2 JSON specs also are now insecure by default, in its relaxed RFC 7159 mode, allowing values such as objects, arrays, strings, numbers, "null", "true", and "false". Wait: default msgpack is also insecure, as you can trivially add packets to the front or end, overriding it. It also accepts cutoff or corrupted packets. Only my patched msgpack version was better, but only for prepending packets, not for added packets after. https://github.com/msgpack/msgpack/pull/114 https://github.com/msgpack/msgpack/pull/114
- masklinn 9y agoFrom my reading, literally the only change between RFC 7159 and RFC 8259 is that the latter mandates an UTF-8 encoding. Checking Appendix A "Changes from RFC 7159" mostly confirms it: * Section 1.2 has been updated to reflect the removal of a JSON specification from ECMA-262, to make ECMA-404 a normative reference, and to explain the particular meaning of "normative". * Section 1.3 has been updated to reflect errata filed against RFC 7159, not RFC 4627. * Section 8.1 was changed to require the use of UTF-8 when transmitted over a network. * Section 12 has been updated to increase the precision of the description of the security risk that follows from using the ECMAScript "eval()" function. * Section 14.1 has been updated to include ECMA-404 as a normative reference. * Section 14.2 has been updated to remove ECMA-404, update the version of ECMA-262, and refresh the errata list. So * RFC 8259 requires UTF-8 encoding (for network transmissions) * ECMA-404 has been upgraded from Informative (14.2) to Normative (14.1) * Wording has been improved or fixed in some cases
- rurban 9y agoYou need to read between the lines and know the history. Restricting to UTF-8 and disallowing the previous allowed UT-16 and UTF-32 BOM's (which my JSON library is the only one which did support that), is the most prominent change, yes. What is troubling to me is that they now prefer relaxed RFC 7159 over strict RFC 4627. The RFC 7159 relaxed mode was a troubled update which harms security, and it should not be turned on by default. And whilst they support now the insecure relaxed variant, they didn't clarify the still problematic points in the spec. MUST disallow duplicate keys, or MAY? It's not specified, or specified twice contradicting itself. Same for broken UTF-8 encodings. Error or warn or silence? It's still much better than the YAML spec though. Minor nitpicks.
- zeveb 9y ago> JSON is still the only secure transportation protocol Ummm, canonical s-expressions[0] and ASN.1's various encoding rules[1] beg to differ. The one thing JSON has that canonical s-expressions don't is maps/hash tables/dicts, but after working with both for quite awhile I've come to the conclusion that maps in the core transport language are actually a mistake. [0] http://people.csail.mit.edu/rivest/Sexp.txt http://people.csail.mit.edu/rivest/Sexp.txt [1] https://en.wikipedia.org/wiki/Abstract_Syntax_Notation_One#Octet_Encoding_Rules https://en.wikipedia.org/wiki/Abstract_Syntax_Notation_One#O...
- rurban 9y agoS-expr are powerful, but too powerful. They do allow object deserialization, which is the insecure part.
- zeveb 9y ago> They do allow object deserialization, which is the insecure part. Only in the exact same sense that JSON allows insecure object deserialisation. Yes, if you process a JSON object or S-expression, your processor can do all sorts of insecure things. But a non-buggy S-expression parser can't do anything wrong with (foo bar "baz"), just as a non-buggy JSON parser can't do anything wrong with ["foo", "bar", "baz"].