3 ms·
Now this is a case for sandboxing. A decompressor has one input file and one output directory. It should not have the power to change any state outside those
by Animats 11y ago
Now this is a case for sandboxing. A decompressor has one input file and one output directory. It should not have the power to change any state outside those files.
A key point here is that not all code needs to be secure. Some code just needs to be kept in a box.
- mentat 11y agoSame with transcoders
- Splines 11y agoEven if it's in a box, you need to pull the thing you want back out of the box. A malicious file could put a payload into the destination file.
- tekklloneer 11y agoYes, by containing the payload and decompressing it. The difference is that by not sandboxing it, that malicious file could also cause its payload to be executed in the permission scope of the decompressor.
- Animats 11y agoThat's pointless. Putting the malicious file in the archive would accomplish the same result.
- doomrobo 11y agoI think OpenBSD's `pledge` syscall would be sufficient in this case. Calling pledge("stdio rpath wpath", {"path/to/input", "path/to/output"}); would blacklist any subsequent syscall that are not in the stdio or rpath or wpath lists [0] or pertain to a file that is not the input or output. [0] http://man.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man2/pledge.2 http://man.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man2/...
- nickpsecurity 11y agoWe're at the point where tools can automatically transform code for safety with OK penalties and some MAC implementations have about no penalties. Yet, still no use on the exact types of tools they're easiest to apply to. (Shakes head.)