← Sun, Nov 8 digest

I'm not a fan of Deno's security model (2024)

read article ↗ hn thread ↗

Deno's permission and security model is fundamentally flawed and provides a false sense of security, remaining vulnerable to terminal prompt spoofing and environment manipulation.

read it A detailed technical breakdown with reproducible bypass examples showing why Deno's runtime permission model fails against malicious code.

summary

The author argues that Deno's permission system provides a false sense of security rather than true sandboxing. It demonstrates concrete bypasses including terminal prompt spoofing via shared stdio, PATH manipulation for execution permissions, and LD_PRELOAD environment injection. The piece concludes that runtime permission filters cannot replace proper OS-level sandboxing.

key points

  1. Terminal prompt inputs can be manipulated because prompts share an in-band stdout/stdin channel with untrusted code.
  2. The allow-run flag can be bypassed by altering the PATH environment variable to execute malicious binaries.
  3. Passing LD_PRELOAD via environment variables enables dynamic library injection for complete sandbox escapes.

who should read it

Backend developers and security engineers evaluating runtime permission models.

discussion mixed

consensus

Commenters largely agree with the critique, acknowledging that Deno's permission model is more useful for preventing accidental developer errors than stopping determined malicious code.

pushback

A minority argues that even imperfect guardrails are valuable for preventing accidents, and implementing true async capability systems at the language level is exceptionally difficult.

best comment by cadamsdotcom ↗

Re the first point: stdio only offers one way to interact with users. stdio is what pulls naive designers into this trap - untrusted output sharing a channel with trusted decision input.

Deno should disallow arbitrary output on stdout/stderr. Even prefixing the lines won't work because control characters like ^H are sent in-band and can delete the prefix.

The "in-band vs. out-of-band" is nothing new. Worth looking up 2600hz, the signaling frequency of the US phone system way back when. Pick up a handset, generate a 2600hz tone. Suddenly you're talking to the call routing system. Only a few …

It illustrates the architectural dangers of in-band signaling by comparing Deno's stdio vulnerability to historical telephone system phreaking.

Generated by an LLM from the article and thread. Check the sources before relying on it.