by TacticalCoder · 3y ago · 0 comments
It's more the development and specs of Unicode that did miss a lot of things. When Unicode came out Bruce Schneier envisioned all the attacks that'd inevitably come and he was, of course, totally right.
As he put it a quarter of century ago (2000): "Unicode is just too complex to ever be secure".
It's Unicode that did fuck up, not developers who are forced to deal with non-sensical things because somewhere a committee decided that it'd make sense to use a broken system for domain names (for example).
Or do you have thoughts on what a "simplified Unicode" — that accomplishes all the same goals — would look like?
Unicode is fine for what it is - conveying text across languages and scripts. The problem is that some environments use the filename as more than what it should be (a memo field for the user and not an instruction for the machine whether to execute the file as code).
What's complex about that? That's just an ordinary sequence of code points, no different than if there was only one language involved.
Unicode has problems where the same thing is represented several different ways. It's not a problem for different things to be represented in different ways.
That's needed for compatibility with legacy encodings.
But when most people — including the GGP poster — complain about this, they aren't usually thinking of canonically-equivalent codepoints, but rather of homoglyphs: codepoints that just happen to have the same conventional pictorial representation. But which have different (collation/splitting/etc) properties; or, more interestingly, different (machine-readable!) semantics.
Most often, phishing "text confusion" is done using homoglyphs. (And, in fact, in some text-processing libraries — e.g. Punycode — "text confusion" can only happen using homoglyphs, as canonically-equivalent Unicode codepoints get normalized to just one option.)
The reason that the homoglyphic Latin "M" and Cyrillic "М" codepoints exist in Unicode isn't for legacy reasons. It's rather because Cyrillic "M" sorts after Cyrillic "Р" (and both of them come before Cyrillic "С"!) You can't have alternate collation orderings if you're using the same codepoints for both languages.
The reason that both Greek "π" and mathematical "𝜋" exist in Unicode, is because one codepoint "is" a letter, and the other codepoint "is" a symbol. This "is"-ness has nothing to do with the glyphs, but rather is basically a type system inside Unicode, that user-agents besides those that render text often rely upon. "𝜋" (the symbol) can carry a particular semantic meaning in text to machine user-agents, that "π" (the letter) does not. Translation systems should treat them differently. Dictionaries should treat them differently. Filter rules for usernames should treat them differently. Etc. (And that's beside the fact that they also have different Unicode properties. "π", as a letter, doesn't create implicit split-boundaries on either side of it; while "𝜋", as a symbol, does.)
> It's Unicode that did fuck up, not developers who are forced to deal with non-sensical things because somewhere a committee decided that it'd make sense to use a broken system for domain names (for example).
I'm not sure that's unicode's fault. Their goal is to produce a standard for encoding ~all written text. It may seem like this would be something cool to support in your program of choice, but in lots of applications that flexibility leads to vulnerabilities. I think developers need to be aware of these risks and design around them (for example by limiting the allowed characters in certain contexts).