News for hackers. Stuff that matters.
Re:Deno 1.0 by frank2 on Wednesday May 13, 2020 @07:31PM (#23173123)
Does it also terrify you when code running in a browser does it?
Re:Deno 1.0 by Saaster on Wednesday May 13, 2020 @07:36PM (#23173168)
The code running in my browser isn't a multi-tenant production server, with access to the filesystem and DBs.
Re:Deno 1.0 by 0beah on Wednesday May 13, 2020 @08:01PM (#23173385)
Except that with Deno, everything IO related is turned off by default and has to be granted access before it becomes a process. It's the first bullet point on the landing page.

Here is the page with more detail. https://deno.land/manual/getting_started/permissions

It can even restrict access down to a specific directory or host. This is cool.

Whereas any NPM module can map your subnet, lift your .ssh directory, and yoink environment variables, wily-nily.

It's happened before.

Re:Deno 1.0 by sterlind on Wednesday May 13, 2020 @08:12PM (#23173483)
That still doesn't prevent imported modules from yoinking anything you did grant access to, though. For instance, if my service connects to a DB then `uuid` can slurp the contents.

It'd be nice to have some capability model where modules can only access things through handles passed to them, but probably infeasible for a project like this.

Re:Deno 1.0 by mrkurt on Wednesday May 13, 2020 @08:16PM (#23173514)
You can actually run things as Workers in Deno and get some sandboxing abilities: https://github.com/denoland/deno/blob/master/docs/runtime/wo...
Re:Deno 1.0 by yawn on Wednesday May 13, 2020 @07:44PM (#23173245)
From the article: "Also like browsers, code is executed in a secure sandbox by default. Scripts cannot access the hard drive, open network connections, or make any other potentially malicious actions without permission."
Re:Deno 1.0 by hombre_fatal on Wednesday May 13, 2020 @07:48PM (#23173271)
That just means you have to run with the -http -fs, etc. flags. But you are using those when writing any nontrivial Deno app like a webserver anyways.

"web browsers already do this ;)" isn't a good comparison.

Re:Deno 1.0 by mrkurt on Wednesday May 13, 2020 @08:06PM (#23173428)
"But I have to turn all that stuff on" is also not a good comparison.

Actually, no Deno webserver I've written gets fs access. Some only get --allow-net.

Re:Deno 1.0 by XCSme on Wednesday May 13, 2020 @07:50PM (#23173285)
I think that's the main selling point of deno, sandboxing.