Description
Feature Request
Overview
Lines 139 to 142 in c4103c1
Lines 112 to 116 in c4103c1
The current behaviour is for the WASI/WASM module to exit the process when __wasi_proc_exit
is called. Not only that, currently it also allows the WASI module to control the exit code.
This seems like a capability that should be explicitly provided to the module rather than something that is on by default. It's unintuitive that a process running in a sandbox would have the ability to crash the entire app without the caller giving it explicit permission to do so.
This is particularly an issue when running 3rd party modules since you rarely have a complete idea on when and where the module might call __wasi_proc_exit
and with what exit codes.
Returning instead of exitting when a sandboxed process finishes aligns better with the principles of least privilege and secure by default.
Context
#46254 (comment)
https://github.com/nodejs/node/blob/main/test/wasi/test-return-on-exit.js