-
-
Notifications
You must be signed in to change notification settings - Fork 132
Closed
Description
Feature request.
Most third part module we are using are pure function things. If we can control that (when we require them even install them), then maybe most security problems could under control easily?
"pure module require" means:
- no i/o, like
fs,netnative module. - no context pollute, like viciously rewritting to standard lib and native module exports.
- other things, like
Buffer.allocUnsafe,child_processAPI. pkg.scriptsfield actions will have no chance to attack the computer.- pure module can only require pure module.
soft additional design objective:
- maybe we need "pureAsync", different with "pure(Sync)", to give a way auto force run in "Worker"-like thing, to protect "while ( true ) ;" (and bind to cpu different with main app context). not very important, because it's almost no benefit for author, and easy to be found by the most careless user (no different with a lib has no user just because it's too slow).
- maybe we need consider "import" solution together, like "import mod from 'x' assert { pure: 'sync' }".
Reactions are currently unavailable