Open caspervonb opened 3 years ago
I agree with the general approach as I specified in the other issues.
I want to better understand what is being proposed and what implementation tradeoffs are we willing to make.
About the permissions list itself, do we:
Similar issues for the input paths in filesystem ops:
Deno.readTextFile()
but instead let file = Deno.getFileHandle('/tmp/myfile'); let s = file.readText(); file.writeTest('something');
(this enables us to hold a file-descriptor inside the file
object, so it doesn't change "beneath our feet")
Currently permission checks only look at the paths they were provided which may be a symbolic link. This allows you to escape the sandbox with symlinks which were just stabilized in https://github.com/denoland/deno/pull/9226
Most of the filesystem ops that deal with paths should always use the canonical path when checking permissions within the ops, the exception would be stat since there is an lstat and the link won't be followed later in the actual syscall.
There are other ways to we can go about it (capability based preopens with openat for example ala WASI), but not with our current permission model resolving to the true path is the way to go forward imho.
Related but without an actionable item https://github.com/denoland/deno/issues/2318.