Re:Reflections on Distrusting xz
by JoshTriplett on Wednesday April 03, 2024 @06:04AM
(#39915438)
> the only reliable solution is security through compartmentalization
I hope we get there eventually. Not just for standalone processes, but for individual libraries. A decompression library could run inside a WebAssembly sandbox, with the compressed file as input, the uncompressed file as output, and no other capabilities.
Re:Reflections on Distrusting xz
by funcDropShadow on Wednesday April 03, 2024 @06:19AM
(#39915533)
What does this have to do with WebAssembly? That is another runtime that adds complexity. Apple has been sandboxing codecs for a long time. They run in a sandboxed process that is only communicating through stdin and stdout or something similar, if I remember correctly. You can ran native code directly. Adding a runtime with a JIT-compiler makes it harder to understand what is going on.
Re:Reflections on Distrusting xz
by JoshTriplett on Wednesday April 03, 2024 @06:46AM
(#39915718)
WebAssembly can be run in-process rather than requiring a process switch, and it can be easier to port library code to run inside a WebAssembly sandbox than a completely separate process. Also, sandbox mechanisms for separate processes are not always as robust, since they have to give access to any direct syscalls the process makes, whereas WebAssembly completely insulates a library from any native surface area.
Re:Reflections on Distrusting xz
by 01HNNWZ0MV43FF on Wednesday April 03, 2024 @06:22AM
(#39915563)
There's AOT wasm too. Firefox uses it to sandbox some stuff. https://hacks.mozilla.org/2021/12/webassembly-and-back-again...
WebAssembly is the new Rust, I think
Hey, no one proposed to rewrite xz in Rust yet! I'm sure that would automatically protect any project from social engineering attacks!
Running xz in a sandbox would not prevent an attack that causes it to modify source code in a .tar.xz that is being streamed through it.
Re:Reflections on Distrusting xz
by JoshTriplett on Wednesday April 03, 2024 @09:32AM
(#39917219)
No, it wouldn't, but that wasn't the attack here. And code outside the sandbox could check a checksum of the uncompressed data, to ensure that the decompression can't misbehave.
If you generalize this problem further, to all packages, then the only reliable solution is security through compartmentalization. On Qubes OS, any file I open, including .jpg and .avi, can't have the access to my private data or attack the admin account for the whole computer. This is ensured by hardware-assisted virtualization.