r/programming • u/guest271314 • Dec 15 '24
Proof of concept showcasing how a WASM program can access files outside node:wasi's preopens dir
https://github.com/humodz/node-wasi-preopens-escape
31
Upvotes
View all comments
Show parent comment
20
u/anxxa Dec 15 '24
My mistake. Your somewhat defensive tone in this thread made me believe you were responsible for the PoC.
I think it's pretty clear: the file system APIs do not provide sufficient security guarantees if you want to use it for sandboxing untrusted WASM. Therefore do not use it if you wish to sandbox untrusted code.
Sure they could have a tracking issue linked for more details and specific examples of known gaps. You should open a PR if not having one frustrates you.
To reiterate my above comment: my point is that the PoC README concludes "Do not rely on node:wasi to run malicious code, as it can access files outside the preopens directory," which makes it look like uvwasi attempts to make security promises surrounding the filesystem APIs which is definitely not the case.