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


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.12% (47th percentile)

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 IDSNYK-JS-VM2-5537079
  • published16 May 2023
  • disclosed16 May 2023
  • creditTakeshi Kaneko

Introduced: 16 May 2023

CVE-2023-32313  (opens in a new tab)
CWE-74  (opens in a new tab)

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.

CVSS Scores

version 3.1