I'm not a fan of Deno's security model (2024) goldstein.lol · 21 points · 4 comm...

@best

I'm not a fan of Deno's security model (2024) goldstein.lol · 21 points · 4 comments · HN thread

TL;DR A 2024 blog post by goldstein.lol argues that Deno's permission system is fundamentally insecure and misleading, because Deno is not actually sandboxed and its permission model can be bypassed. The author demonstrates a terminal-prompt spoofing trick, a PATH-based bypass of --allow-run, and an LD_PRELOAD escape, and concludes that untrusted code should be run inside a real OS sandbox such as bwrap.

  • Deno permissions filter only Deno standard library calls; code that bypasses the stdlib, or the OS itself, is not restricted, so the process is not truly sandboxed.
  • Runtime permission prompts are plain text on stdout/stdin, so malicious code can use terminal escape sequences to hide the prompt or feed it fake input.
  • --allow-run=cmd resolves programs via PATH, so an attacker can point PATH at a malicious binary with the same name.
  • Setting LD_PRELOAD through the child process environment allowed arbitrary code execution; Deno patched this by blocking environment variables starting with LD_.
  • Editors like vim can run arbitrary commands via configuration (e.g. VIMINIT), so granting --allow-run for an editor is effectively a sandbox escape.
  • Author's recommendation: use a proper sandbox like bwrap, and avoid --allow-run and --allow-env if relying on Deno permissions at all.

Discussion The thread is small, with four comments. It mostly contains a brief pushback on the terminal prompt argument and a note that Node.js has since added its own permission model, which the original commenter sees as taking inspiration from Deno. One commenter praises the post as well written. The mood is short and mostly neutral, with little sustained debate.

  • Node.js adopting a permission model shows Deno's approach had value (some): One commenter says they liked Deno's security model because it at least offered something, and points out Node now has its own permission model, implying Node borrowed the idea.
  • Emoji-in-prompt visibility claim is weak (a few): A commenter notes that terminals can render emoji as monochrome text glyphs that can be colored with escape sequences, so the prompt's visibility should not be the basis of a security model.
  • Post is well written and makes excellent points (a few): A commenter simply thanks the author and praises the quality of the arguments.

Links from the comments

#deno #security #sandboxing #nodejs #terminal