Question: Is it safe to execute a compiled dart program as root

32 views
Skip to first unread message

Felix Barz

unread,
Jan 27, 2023, 1:11:59 AM1/27/23
to Dart Misc
Hi. First of all, I am unsure if this is the right place to ask this question. If I should move it somewhere else, feel free to tell me.

Now to the topic itself. I am planning on building a small dart application that should run on a linux machine as the root user. My question here is: Is this safe to do, or are there some caveats one should be aware of before doing this.

For context: I am planning on deploying the application as precompiled dart "exe" without debugging information.

Slava Egorov

unread,
Jan 27, 2023, 2:56:29 AM1/27/23
to mi...@dartlang.org
You need to define your threat model and give us at least some details on what your program does before we can give any meaningful answer. 

Without knowing more the best I could personally say is that running a Dart program under root is as safe as running a C program under root.  

--
For more ways to connect visit https://dart.dev/community
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/d6eb3f59-655e-4c40-975e-d79867030177n%40dartlang.org.

Brett Sutton

unread,
Jan 27, 2023, 3:20:50 AM1/27/23
to mi...@dartlang.org
Yes it's fine. I do it every day.

 It however is not safe to run a non compiled program, the problems are many.

--

Felix Barz

unread,
Jan 28, 2023, 4:16:18 PM1/28/23
to Dart Misc, Vyacheslav Egorov
Yeah, I was asking about the language itself, as there are frameworks out there that explicitly warn against beeing used in a root environment. But if the dart language itself is fine (which I already thought it is, just wanted to make sure), thats fine. I am planning on writing a small wrapper around zfs to be exposed via SSH to limit the possible interactions with zfs to the bare minimum needed for my use case.

Felix Barz

unread,
Jan 28, 2023, 4:16:18 PM1/28/23
to Dart Misc, bsu...@noojee.com.au
Thats good news. I am aware that running any application as root is inherently dangerous at some level, but my question was aiming at the dart language itself, as there are Frameworks and Libraries out there that explicitly warn against beeing used in a root environment. I was not expecting dart to be problematic, but I wanted to make sure.

I also am aware that having non compiled script is problematic, but I won't do that.
Reply all
Reply to author
Forward
0 new messages