3 ms·
Question: why don't we: 1. put a reference to the decoder into the header of the compressed file 2. download the decoder only when needed, and cache it if req
by amelius 3y ago
Question: why don't we:
1. put a reference to the decoder into the header of the compressed file
2. download the decoder only when needed, and cache it if required
3. run the decoder inside a sandbox
4. allow multiple implementations, based on hardware, but at least one reference implementation that runs everywhere
Then we never need any new formats. The system will just support any format. When you're not online, make sure you cached the decoders for whatever files you installed on your system.
- tinus_hn 3y agoWe used to have formats like this, and then the attacker points to his decoder/malware package. Apart from that of course the decoder has to be fast and thus native and interface with the OS, so the decoder is X86 on the today version of Windows, until the company hosting it dies and the patented, copyrighted decoder disappears from the internet.
- Dylan16807 3y agoFormats like what? You're not skipping the "sandbox" part are you? A decoder can be extremely isolated. It's much easier to sandbox a decoder than to sandbox javascript, for example.
- tinus_hn 3y agoIf you assume you just say the magic word ‘sandbox’ and everything is safe, then yes, security is a solved problem. This is however a prime example of the saying that in theory, there is no difference between theory and practice but in practice there is.
- Dylan16807 3y agoYou're treating sandboxing like it's all the same, but it's not. Multimedia decoders are one of the absolute easiest things to sandbox. Webassembly was designed for sandboxing and even that's very overcomplicated for what a decoder needs. If we had standard headers, then reading metadata wouldn't be part of the decoder. The decoder would only need to take in bytes and output a bitmap, or take in bytes and output PCM audio. It doesn't need to be able to call any functions, or run any system calls, and the data it outputs can safely contain any bytes because nothing will interpret it. It's like taking the very core of webassembly and then not attaching it to anything. The attack surface is astoundingly small. You just need to give it a big array of memory and let it run arithmetic within that array, plus some control flow instructions. Easy to interpret, easy to safely JIT compile.
- tinus_hn 3y agoI suggest you try building it and see ‘just’ how easy it is.
- Dylan16807 3y agoI have made secure emulators for simple CPUs before. Seriously, you only need a handful of opcodes and they only need to operate on a big array. It's hard to do wrong! The part of sandboxing that's hard is dealing with I/O, or giving useful tools to the sandboxed code, or implementing data structures for the sandboxed code. You don't need any of that for a multimedia decoder. You just let it manipulate its big block of bytes, and make sure you bounds check. A Java VM exposes tens of thousands of functions to the code inside it. A barebones sandbox exposes zero. It just waits for the HLT opcode. And when it gives you raw RGB data, or raw PCM data, there's no way to hide a triggerable malicious payload inside. If the code does something bad, the worst it can do is show you the wrong image.
- tinus_hn 3y agoYes, and you can also download a million projects like this, the sandbox exists. But my suggestion would be that you build a video codec out of it. Preferably one that has the properties the market demands: performance and energy efficiency.
- Dylan16807 3y agoNot a codec, the only thing customized for this would be the container format. You'd use existing codecs, and the way you get good performance and energy efficiency on a video codec is by having a hardware implementation. Software decoding doesn't even come into that picture. As far as practical software decoding outside of battery-powered video, can I just point at webassembly? Especially the upcoming version with vector instructions. You could use normal webassembly, or even an extra-restricted version. It gets pretty good performance, and when you remove its ability to talk to the outside world it goes from pretty good to extremely good security.
- ElectricalUnion 3y agoThis is what PrintNightmare did? You no longer need "printer drivers", they're supposed to be automatically downloaded, installed and ran in a sandbox. You never need any "new drivers". The system will support any printer. Except the "sandbox" was pretty weak and full of holes.
- amelius 3y ago> Except the "sandbox" was pretty weak and full of holes. Nothing prevents you from installing only the trusted ones. Second, software is getting so complicated that if we don't build secure sandboxes anyway then at some point people will be bitten by a supply chain attack.
- paulddraper 3y agoBecause that is complex, unnecessary, and dangerous?
- kalleboo 3y agoYou can’t cache things online anymore as that is a way to track people (generate a unique “decoder” per user and check if they have it cached or not)
- amelius 3y agoThe solution is to cache things per user, not system wide. Or per "container" like in Firefox containers.