Re:Arbitrary file write vulnerability in GNU gzip's zgrep ut...
by nightfly on Monday April 18, 2022 @10:28PM
(#31079225)
Makes things like UTF8 and other new encodings easier. Everything has to support that nearly anything can be in a filename
[ Parent
| on HN ]
Re:Arbitrary file write vulnerability in GNU gzip's zgrep ut...
by Thorrez on Tuesday April 19, 2022 @04:23AM
(#31080782)
It doesn't directly help UTF8, since all the bytes it uses for encoding non-ASCII have the high bit set.
It might directly help with UTF16, I'm not sure.
But the general idea of "block only a few specific characters (\0 and /) and allow all the rest" does help with UTF8. If the designers said something like "only ASCII letters and number and dashes and underscores" then that would block UTF8, and we might end up with something like URL hostnames, where you use punycode to encode non-ASCII into ASCII.
Re:Arbitrary file write vulnerability in GNU gzip's zgrep ut...
by gpderetta on Tuesday April 19, 2022 @05:33AM
(#31081147)
The point is that unix behaviour is to treat filenames as byte strings, so no particular encoding is mandated by the kernel or by most tools. That made the transition to utf-8 fairly painless.
Re:Arbitrary file write vulnerability in GNU gzip's zgrep ut...
by lupire on Tuesday April 19, 2022 @07:31AM
(#31081766)
So it's easier to write insecure software. Wrong priorities.
Re:Arbitrary file write vulnerability in GNU gzip's zgrep ut...
by ElectricalUnion on Tuesday April 19, 2022 @09:58AM
(#31083168)
> easier to write insecure software.
Not filtering untrusted inputs, and not escaping or handling them correctly is how you write insecure software. Arbitrary input guarantees (unless very strict, then that's indirectly filtering inputs anyways) don't change that.
Re:Arbitrary file write vulnerability in GNU gzip's zgrep ut...
by Thorrez on Wednesday April 20, 2022 @03:35AM
(#31093869)
Why does that make it easier to write insecure software? Which is easier: dealing with bytes, only 2 of which have special meanings (/ and \0) or dealing with a ton of different character classes, each of which you have to think about and code for. The second case happened with URLs, so there's all sorts of weird rules about you can have a ? in this section but not that section, and percent encoding and punycode and stuff like that.