Sandbox Breakout / Arbitrary Code Execution in @zhaoyao91/eval-in-vm

@zhaoyao91/eval-in-vm Updated 02 Oct 2025

Summary

04/09/2020
CRITICAL
No i
Critical
Not published

GHSA-jp99-5h8w-gmxc: Sandbox Breakout / Arbitrary Code Execution in @zhaoyao91/eval-in-vm. Affects @zhaoyao91/eval-in-vm versions >= 0.0.0. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

The @zhaoyao91/eval-in-vm package is an npm package that provides a sandboxed environment for evaluating JavaScript code. It allows users to execute code within a virtual machine, providing a layer of security by isolating the code from the main context. However, all versions of this package are vulnerable to a Sandbox Escape vulnerability, which can lead to Remote Code Execution. The vulnerability arises from a failure to restrict access to the main context through this.constructor.constructor. This allows attackers to execute arbitrary code in the system, potentially leading to unauthorized access or control over the host environment.

Vulnerability Detail

The Sandbox Escape vulnerability in @zhaoyao91/eval-in-vm allows an attacker to break out of the sandboxed environment and execute arbitrary code in the system. By leveraging the this.constructor.constructor property, an attacker can access the main context and execute malicious code. For example, evaluating the payload this.constructor.constructor('return process.env')() would print the contents of the process.env object, potentially exposing sensitive information. This vulnerability poses a significant risk as it enables remote code execution, which can lead to unauthorized access, data breaches, or system compromise.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As there is no fix available, a workaround for this vulnerability is to manually review and validate any code executed within the sandboxed environment. Ensure that untrusted code is not executed and restrict access to sensitive resources. Additionally, consider implementing additional security measures such as code reviews, input validation, and access controls to mitigate the risk of code execution vulnerabilities.

Conclusion

The @zhaoyao91/eval-in-vm package is vulnerable to a Sandbox Escape vulnerability, which allows attackers to execute arbitrary code in the system. Currently, there is no fix available for this vulnerability, and it is recommended to avoid using the package until a fix is provided. Mitigation strategies include switching to alternative packages and implementing additional security measures. For further support on vulnerability remediation, you can reach out to DevNack.com.

See every vulnerability recorded for @zhaoyao91/eval-in-vm →

Share this vulnerability

FAQ

The vulnerability allows an attacker to break out of the sandboxed environment and execute arbitrary code in the system. This can lead to unauthorized access, data breaches, or complete compromise of the host environment.

Currently, there is no fix available for this vulnerability. It is recommended to avoid using the @zhaoyao91/eval-in-vm package until a fix is made available.

Yes, all versions of the @zhaoyao91/eval-in-vm package are vulnerable to this Sandbox Escape vulnerability.

To mitigate the risk, it is recommended to avoid using the @zhaoyao91/eval-in-vm package and switch to an alternative package that does not suffer from this vulnerability. Additionally, implement security measures such as code reviews, input validation, and access controls to reduce the risk of code execution vulnerabilities.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback