4 ms·
I think JavaScript/Clojurescript is the exception because they control the runtime and JIT: whether or not you buy their explanation, I think the reason they st
by fiddlerwoaroof 6y ago
I think JavaScript/Clojurescript is the exception because they control the runtime and JIT: whether or not you buy their explanation, I think the reason they state is that this is to enable sandboxing. This is at least plausible to me: to have effective sandboxing, you need to restrict the APIs that a device can call, which means blocking the ability to generate and run arbitrary machine code on-device.
- josephcsible 6y ago> This is at least plausible to me: to have effective sandboxing, you need to restrict the APIs that a device can call, which means blocking the ability to generate and run arbitrary machine code on-device. This isn't true. You can sandbox arbitrary machine code by restricting the process it runs in (this is how seccomp works on Linux).
- roblabla 6y ago> to have effective sandboxing, you need to restrict the APIs that a device can call, which means blocking the ability to generate and run arbitrary machine code on-device. Please, no, this is not how security and sandboxing works at all. Otherwise, the moment you have an arbitrary code vulnerability, you'd get full access to everything. The way effective sandboxing works is by giving a process a set of capabilities/permissions, what have you, that is enforced by the kernel. Those permissions can be "can I open files", "can I talk to the camera subsystem", etc. Then, even if you somehow manage to generate the right function call at runtime, the call will fail. And to be clear, this is how apple's own security works.
- fiddlerwoaroof 6y agoWouldn’t you have this as part of a defense in depth strategy? Apple’s public vs. private APIs and similar things seem to indicate that at least part of their security model involves static analysis of binaries and only allowing a set of approved APIs.
- saagarjha 6y agoApple's static analysis to detect private API usage is not very clever; you can get around it with some fairly trivial tricks.
- roblabla 6y agoNo, it's not a security mechanism period. Public/Private APIs aren't part of the security model, it's a way to prevent app breakage in their ecosystem due to applications using unstable APIs.
- yoz-y 6y agoBut iSH isn’t running arbitrary machine code, it’s a x86 emulator running Linux inside. It’s more sandboxed than a JS runtime, which actually does compile down to machine code.