crossvm
v0.0.9-beta
Published
Browser compatible Node VM
Downloads
16
Readme
Cross VM
Browser compatible Node VM
By using this library you will be able to containerize JS codes and evaluate the codes in the browser
Install
Sadly for now you can only use NPM to use this package.
(Webpack-bundle is coming)
npm install --save crossvm
Testing
Writing tests is in progress
Example
Look at Node's VM official documentation
Note
CrossVM is not a security mechanism. Do not use it to run untrusted code.
There is always a way to get out of sandbox like:
const {createContext, run} = require('crossvm');
const context = createContext();
run('"".constructor.constructor("return this")().console.log=()=> { throw new Error("pwnd");}', context);
console.log("Hello world");
(Thanks to Dark Marouane for clarifying this)