AMAZINGINDEX.COM 每天向上一点
47.1
VOL. 2026.11
2026.11.09
← 返回 2026.11.09 日报
日报快照 · Daily Snapshot
NO. 022

Deno 权限模型被质疑不安全

#ARTICLE HackerNews 2026.11.09
推荐指数 51.0 NO. 022 · 2026.11.09
发布2026/11/08Score69Comments31

开发者发文指出 Deno 的"安全 by default"权限系统存在根本性设计缺陷,认为其容易误导用户产生虚假安全感。对运行 Node/Deno 服务的后端工程师有警示意义,权限模型的实现细节可能比营销话术更重要。

Deno 的权限粒度(读文件、写文件、网络)其实比 Chrome 的 site isolation 粗得多,而后者才是 Ryan Dahl 当初声称要借鉴的模型。真正的问题是:Deno 的权限提示发生在运行时而非安装时,这意味着恶意依赖可以在你执行测试或构建时弹出请求,而用户习惯性点"允许"的概率极高。

如果你在用 Deno 跑 CI/CD 或处理用户上传的代码,建议把 --allow-all 当成默认假设来设计防御,而不是依赖其权限系统作为安全边界。更务实的替代方案是考虑用 gVisor 或 WASM 做真正的沙箱隔离。

负面 30 条评论

核心争论:Deno 权限模型是'有总比没有好'还是'虚假安全感比无防护更危险'

hoppp

Deno has 1 year of official support left... I liked the security model because at least they had something, unlike node.

illright

Node actually took that from Deno, they do have a permission model now: https://nodejs.org/api/permissions.html

zdragnar

From their documentation: > It does not provide security guarantees in the presence of malicious code. Malicious code can bypass the permission model and execute arbitrary code without the restrictions imposed by the permission model. The permission model is more of a "help developers not accidental

替代方案: Node.jsSafeScriptOS-level security mechanisms
查看原文 →