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
-13
u/guest271314 Dec 15 '24
Not sure what information you are trying to convey?
You linked to and quoted the vague Node.js documentation that lead me to investigate precisely what the authors of that vague disclaimer/warning meant.
The only vector that I have come across, if you want to call it that, disclosed and authored by https://github.com/humodz, is the one demonstrated in the linked GitHub repository.
You essentially have to hack yourself for the
node:wasiimplementation to be a vector.However, the WASI specification includes some language that goes something like even if another application tries to subvert the process, the WASI implementation should stay "sandboxed".
Granted, I didn't run the exact same code using an asynchronous loop to create a WASI runtime context with
wasmtimeto see if the same "escape" happens there.