Property
Languagejavascript
Severitymedium
CWECWE-94: Improper Control of Generation of Code (‘Code Injection’)
OWASPA03:2021 - Injection
Confidence LevelMedium
Impact LevelMedium
Likelihood LevelMedium

Description#

Using the Node.js ‘vm’ module to execute code that includes user input is unsafe, as it allows attackers to inject and run arbitrary JavaScript. This occurs when untrusted data is passed to ‘vm’ functions like runInContext or compileFunction.

Impact#

If exploited, an attacker could execute malicious code on your server, potentially accessing sensitive data, modifying application behavior, or compromising the entire system. This can lead to data breaches, service disruption, and further attacks within your environment.