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

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

Open
Satont opened this issue Aug 14, 2022 · 0 comments
Open

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

Satont opened this issue Aug 14, 2022 · 0 comments

Comments

@Satont
Copy link

Satont commented Aug 14, 2022

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

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

No branches or pull requests

2 participants