Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') Affecting vm2 package, versions <3.9.18


0.0
medium

Snyk CVSS

    Attack Complexity Low

    Threat Intelligence

    Exploit Maturity Proof of concept
    EPSS 0.07% (31st percentile)
Expand this section
NVD
5.3 medium

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk ID SNYK-JS-VM2-5537079
  • published 16 May 2023
  • disclosed 16 May 2023
  • credit Takeshi Kaneko

How to fix?

Upgrade vm2 to version 3.9.18 or higher.

Overview

vm2 is a sandbox that can run untrusted code with whitelisted Node's built-in modules.

Affected versions of this package are vulnerable to Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') via the inspect method of vm.js, which allows write permissions. Exploiting this vulnerability allows an attacker to edit options for the console.log command.

Workaround

Users unable to upgrade may make the inspect method readonly with vm.readonly(inspect) after creating a VM.