Sandbox Breakout / Arbitrary Code Execution in veval

veval Updated 02 Oct 2025

Summary

04/09/2020
CRITICAL
No i
Critical
Not published

GHSA-54qm-37qr-w5wq: Sandbox Breakout / Arbitrary Code Execution in veval. Affects veval 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

veval is an npm package that provides a sandboxed environment for evaluating JavaScript code. It is commonly used to execute user-provided code in a controlled manner. However, all versions of veval are vulnerable to a Sandbox Escape vulnerability, which can lead to Remote Code Execution. The package fails to restrict access to the main context through this.constructor.constructor, allowing attackers to execute arbitrary code in the system. By evaluating the payload this.constructor.constructor('return process.env')(), an attacker can print the contents of process.env.

Vulnerability Detail

The Sandbox Escape vulnerability in veval allows attackers to break out of the sandboxed environment and execute arbitrary code in the system. This can have severe consequences, as it enables attackers to access sensitive information, modify system configurations, or perform unauthorized actions. The vulnerability arises from the package's failure to properly restrict access to the main context, providing an avenue for attackers to execute malicious code.

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 at the moment, a possible workaround is to avoid using the veval package and switch to an alternative that does not have this vulnerability. By replacing the usage of veval with a safer alternative, the risk of sandbox breakout and arbitrary code execution can be mitigated. Here's an example of how to replace veval with a safer package:

// Replace veval with safer-alternative
const saferAlternative = require('safer-alternative');

// Evaluate code using safer-alternative
const result = saferAlternative.evaluate(code);

Conclusion

The veval package is vulnerable to a Sandbox Escape vulnerability, which can lead to Remote Code Execution. Currently, there is no fix available for this vulnerability. It is recommended to consider using an alternative package and monitoring security advisories for updates. For further support on vulnerability remediation, you can reach out to DevNack.com.

See every vulnerability recorded for veval →

Share this vulnerability

FAQ

veval is an npm package that provides a sandboxed environment for evaluating JavaScript code. It allows executing user-provided code in a controlled manner.

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

No, currently there is no fix available for this vulnerability. It is recommended to use an alternative package until a fix is released.

To mitigate the risk, it is recommended to avoid using the veval package and switch to a safer alternative that does not have this vulnerability.

You can find more information about this vulnerability in the GitHub Security Advisory database. Monitoring security advisories and updates from the package maintainers is crucial to stay informed about any patches or fixes that may be released.

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