Hacker Newsnew | past | comments | ask | show | jobs | submit | more bugtodiffer's commentslogin

Dont


using deno isn't good security practice, their sandbox is implemented like stuff from the 90s


If you're writing server stuff, at the coarse-grained level of isolation that Deno provides you're better off using just about anything else and restricting access to network/disks/etc through systemd. Unlike Deno, it can restrict access to specific filesystem paths and network addresses (whitelist/blacklist, your choice), and you're not locked into using just Deno and not forced to write JS/TS.

See `man systemd.exec`, `systemd-analyze security`, https://wiki.archlinux.org/title/Systemd/Sandboxing


Deno can restrict access to filesystem files or directories, and to particular network domains, see docs for examples. https://docs.deno.com/runtime/fundamentals/security/#file-sy...

However in general I don't think Deno's permission system is all that amazing, and I am annoyed that people call it "capability-based" sometimes (I don't know if this came from the Deno team ever or just misinformed third parties).

I do like that "deno run https://example.com/arbitrary.js" has a minimum level of security by default, and I can e.g. restrict it to read and write my current working dir. It's just less helpful for combining components of varying trust levels into a single application.


Yes it says it can do it, but it has been broken many times because it is shit


> Unlike Deno, it can restrict access to specific filesystem paths and network addresses

deno can do this via --(allow/deny)-read and --(allow/deny)-write for the file system.

You can do the same for net too

https://docs.deno.com/runtime/fundamentals/security/#permiss...


Bubblewrap is another convenient sandboxing tool for Linux: https://wiki.archlinux.org/title/Bubblewrap


Can you expand on this please? Also curious which 90s tech there inspired by.


It is matching strings instead of actually blocking things. That's how sandboxes were implemented when I was a kid.

E.g. --allow-net --deny-net=1.1.1.1

You cannot fetch "http://1.1.1.1" but any domain that resolves to 1.1.1.1 is a bypass...

It's crap security


If security principles are important they should be on a deny-default basis with allow-lists rather than the other way around.

If the deno runtime implements the fetch module itself, then post-resolution checking definitely should be done though. It's more of an bug though than a principled security lapse.


The thing is that this applies to all parts of the sandbox https://secfault-security.com/blog/deno.html


Ah, so by default it's default deny everything but once you need to open up categories, you can't just allow exact what you need in that category? You have to allow the entire category and then deny everything you don't want/need?

That's a bit of a silly model.


> you can't just allow exact what you need in that category? You have to allow the entire category and then deny everything you don't want/need?

No, you can allow access to specific domains, IP addresses, filesystem paths, environment variables, etc, while denying everything else by default. You can for instance allow access to only a specific IP (e.g. `deno run --allow-net='127.0.0.1' main.ts`), while implicitly blocking every other IP.

What the commenter is complaining about is the fact that Deno doesn't check which IP address a domain name actually resolves to using DNS resolution. So if you explicitly deny '1.1.1.1', and the script you're running fetches from a domain with an A record pointing to '1.1.1.1', Deno will allow it.

In practice, I usually use allow lists rather than deny lists, because I very rarely have an exhaustive list on hand of every IP address or domain I'm expecting a rogue script to attempt to access.


Yeah, that was my point, default deny vs default allow.

If you can default deny, then you're good. It's kind of a junior sysadmin mistake, otherwise, I would say.


There are usecases like SSRF where I want to allow any IP, except for my internal network. They promise they can do that, but they cant.


That isn't 90s security, that is just bad code. And bad code was written in the 90s and is still written today.


Is node "sandbox" different? Does it even have a sandbox?


Node does have a permissions system, but it's opt in. Many runtimes/interpreters either have no sandbox at all, or they're opt in, which is why Deno's sandbox is an upgrade, even if it's not as hardened as iptables or Linux namespaces.


but it is easy to build a competitor


Not if you want to be paid in normal countries


changelogs, but not the code?


That's a judgement call. It would be too much to review all code change of all dependencies unfortunately.

The corollary of reviewing all code on all dependency updates is you should review all code or the new deps you add, including the transformation by build processes that might mean what is in the package manager might be different and same for all transitive dependencies.

Same with the language and runtime tooling.

It is too hard to be perfect!


its a fork


UK's predator network was also built to protect kids but in the end is only used for copyright infringement


i thought lite was removed again because it just doesnt work


It's time to switch away from Chrome, anyways.

You can't give the ad-peddlers control over your digital existence.

Firefox has gotten quite good over the years. Personally, I like Zen, which has the UX of Arc, but an open source FF base.


so they technically kind of follow the law but make it as hard as possible?


Personally I feel it's okay but kinda weird. I mean why not call it privacy. Gray pattern, IMHO. For example venice.ai simply doesn't have a privacy setting because they don't use the data from chats. (They do have basic telemetry, and the setting is called "Disable Telemetry Collection").


Maybe just stop giving homework and instead give the kids some time to live. Fixed it for you.


The author teaches a college-level writing class. Are you suggesting that, if you voluntarily take a writing class, it's unreasonable if the professor expects you to do some writing outside of class?


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: