Skip to content

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

@Satont

Description

@Satont
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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions