5 ms·
Which actually makes me more sympathetic to Chrome not (yet) adopting JPEG-XL. Don't get me wrong, I think JPEG-XL is a great idea, but to everyone saying "how
by crazygringo 3y ago
Which actually makes me more sympathetic to Chrome not (yet) adopting JPEG-XL.
Don't get me wrong, I think JPEG-XL is a great idea, but to everyone saying "how can supporting another image format possibly do any harm", this is the answer.
- lxgr 3y agoWhy not implement all image codecs in a safer language instead? That would seem to tackle the problem at its root rather than relying on an implementation's age as a proxy for safety, given that that clearly isn't a good measure.
- crazygringo 3y agoThat's a great question, and I'd love to know the answer.
- lxgr 3y agoOften it's infeasible to justify rewriting a lot of existing code, but my point is that these days this concern shouldn't really be an obstacle to integrating a new codec.
- azakai 3y agoIt should certainly lower the bar of adopting a new codec if the implementation is in a memory-safe language. Even so, it is more code, and somewhat more risk. Lack of safety elsewhere might end up using code that is otherwise safe in order to build an exploit (by sending it something invalid that breaks an invariant, or building gadgets out of it, etc.).
- bombolo 3y agoAdding something in rust into a browser means you now need to bundle all of the needed crates and that your browser now also needs rustc to build… at a minimum. You also need potentially to audit all the crates and keep them up to date and so on… without crates you can't do so much.
- IshKebab 3y agoThere are efforts to do that, notably https://github.com/google/wuffs https://github.com/google/wuffs RLBox is another interesting option that lets you sandbox C/C++ code. I think the main reason is that security is one of those things that people don't care about until it is too late to change. They get to the point of having a fast PDF library in C++ that has all the features. Then they realise that they should have written it in a safer language but by that point it means a complete rewrite. The same reason not enough people use Bazel. By the time most people realise they need it, you've already implemented a huge build system using Make or whatever.
- baz00 3y agoI think they are working on that slowly. Lots of stuff is moving to Swift. Including bits of iMessage.
- nabakin 3y agoI'd guess it's a combination of labor required to rewrite them and that you'd more or less have to use a safe systems language in order to not have a performance regression
- chaxor 3y agoFirefox led a hand in making Rust, so I imagine if there is a browser that can make a more secure browsing experience, it would be Firefox, by making media decoders in Rust.
- circuit10 3y agoThey also have an interesting sandbox thing using WebAssembly: https://blog.mozilla.org/attack-and-defense/2021/12/06/webassembly-and-back-again-fine-grained-sandboxing-in-firefox-95/ https://blog.mozilla.org/attack-and-defense/2021/12/06/webas...
- astrange 3y agoAlmost all people don't want to or aren't capable of implementing image codecs, the safer languages aren't fast enough to do it in, and the people who are capable of it don't want to learn them.
- lxgr 3y agoAll good points, but hopefully Google would be able to find the resources to overcome these?
- astrange 3y agoIt can be overcome with time and it is getting better, those are just the historical reasons it's not already better. Google has contributed lots of fuzzing time and security improvements to eg ffmpeg already.
- lxgr 3y agoDefinitely, but GP was specifically using this as an argument for Google not supporting a codec in Chrome. If anybody can spare the effort to do it safely, it’s them.
- kccqzy 3y agoGoogle encourages all new native code in Android to be written in Rust. Rust-based codecs can certainly reach the speeds of C++. And it does rule out memory safety bugs. https://security.googleblog.com/2022/12/memory-safe-languages-in-android-13.html https://security.googleblog.com/2022/12/memory-safe-language... Of course as the blog post says, just because memory safety bugs are overcome doesn't mean vulnerabilities have stopped; people find other kinds of vulnerability now.
- sudosysgen 3y agoI'm sure that given a middling-to-Google (say, 30k) bounty it would be done. I'd give it a shot, anyways.
- 3y ago