-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic import should respect permissions #2761
Comments
I agree this is indeed a problem comparing to static imports. However currently our dynamic import callback is implemented in |
Or we disallow dynamic import of JSON, or we disallow root breaking for dynamic imports, or we put dynamic imports behind a flag. |
Yes this is a problem. And —allow-net is needed to load remote URLs. @kevinkassimo It’s not so bad - there is a hook in CLI for dynamic import. Security checks can be put there. Line 41 in 54982e9
|
Now that Deno has dynamic imports, file paths no longer need to be hard-coded into the script, making it trivial for a malicious script to probe possible directories in a loop hoping to find a juicy JSON.
According to this comment
import
might one day be able to read more than just JSON files, making this even more problematic and basically defeating the purpose of--allow-read
.I suggest that any import that resolves to a file outside the "main" script's directory should have an explicit "read" permission, such as
--allow-read
or `--allow-read=/path/to/import/".The text was updated successfully, but these errors were encountered: