Skip to content
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

Deno should not import remote files without --allow-net flag #1301

Closed
hisorange opened this issue Dec 10, 2018 · 3 comments
Closed

Deno should not import remote files without --allow-net flag #1301

hisorange opened this issue Dec 10, 2018 · 3 comments

Comments

@hisorange
Copy link

Just experimenting with deno so please excuse my instant misbehave.

But isn't the --allow-net flag's purpose is to encapsuate the process from the network and not let the script access the network without permission?

If this is the case, then we should block imports/require from calling remote urls.

This small snippet allowed me to read and send my secret without net access.

As I seen the --allow-read will block me from reading the filesystem but still the netwoking is available with crafted imports.

@bartlomieju
Copy link
Member

--allow-new flag is used to allow Deno to make network requests.

Imports are implicitly allowed and cached in DENO_DIR for subsequent requests.

@hisorange hisorange changed the title Isn't --allow-net should block network access from imports? Deno should not import remote files without --allow-net flag Dec 10, 2018
@hisorange
Copy link
Author

Wrongly worded title, but my main concern is simple, I can craft new import urls with secrets hidden in them and respond dummy ts codes without --allow-net flag.

@ry
Copy link
Member

ry commented Dec 10, 2018

Yes, this is a bug. Dynamic import should not be allowed unless --allow-net is specified.

I'm in the process of refactoring how dynamic import works (#975) and will add this constraint in the new implementation.

Duplicate of #712 - let's move the discussion there.

@ry ry closed this as completed Dec 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants