vm2 icon indicating copy to clipboard operation
vm2 copied to clipboard

Timeout not working with `while` and `.fill()` with big number

Open Satont opened this issue 3 years ago • 0 comments

import { VM } from 'vm2';
const vm = new VM({
  timeout: 5000,
});
const result = await vm.run(`while (true) {new BigInt64Array(1000000000).fill(100000000n)}`);

This will be runned infinitelly, without any timeouts, and process will use huge amount of ram.

Versions

VM2: 3.9.10 Node: 18.7.0

Satont avatar Aug 14 '22 13:08 Satont