Critical Sandbox Escape Vulnerability in @nyariv/sandboxjs

@nyariv/sandboxjs Updated 27 Jan 2026

Summary

27/01/2026
CRITICAL
Yes i
Critical
10.0

GHSA-wxhw-j4hc-fmq6: SandboxJS has Sandbox Escape via Unprotected AsyncFunction Constructor. Affects @nyariv/sandboxjs versions < 0.8.26. Fixed in 0.8.26. 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

The @nyariv/sandboxjs package is designed to provide a secure environment for executing JavaScript code by sandboxing the execution context. It replaces the global Function constructor with a safe version to prevent unauthorized access to the host environment. However, it has a critical vulnerability that allows attackers to escape the sandbox and execute arbitrary code in the host environment.

Vulnerability Detail

The vulnerability arises from the lack of mappings for AsyncFunction, GeneratorFunction, and AsyncGeneratorFunction in the sandboxing mechanism. When an async function is created within the sandbox, accessing its .constructor property retrieves the native AsyncFunction constructor instead of the sandboxed version. This allows attackers to create functions that execute outside the sandbox, leading to Remote Code Execution (RCE) and full access to the host environment.

How To Fix

Latest published version: 0.9.7 as of 23 Oct 2026

npm install @nyariv/sandboxjs@0.9.7

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

0.8.26

This is the first release that contains the fix.

npm install @nyariv/sandboxjs@0.8.26

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, avoid using async functions within the sandbox until the package is updated. If you must use async functions, consider implementing additional security measures to validate and sanitize the code being executed.

Conclusion

The @nyariv/sandboxjs package has a critical vulnerability that allows sandbox escape through unprotected AsyncFunction constructors. It is essential to update to version 0.8.26 or later to secure your application. Utilize tools like Vulert for real-time monitoring of open-source vulnerabilities.

See every vulnerability recorded for @nyariv/sandboxjs →

Share this vulnerability

FAQ

The CVSS score of this vulnerability is 10.0, indicating a critical severity level.

You can use Vulert to monitor and alert for open-source vulnerabilities in your software. Visit Vulert Scanner to check if your application is affected without any signup.

An attacker exploiting this vulnerability can execute arbitrary code in the host environment, leading to severe security breaches and data compromise.

Yes, avoid using async functions in the sandbox and implement additional security measures to validate the code being executed.

If immediate updates are not possible, consider isolating the affected application from sensitive data and monitoring for any suspicious activity.

Related vulnerabilities

Recent vulnerabilities recorded for @nyariv/sandboxjs.

How To Fix

Latest published version: 0.9.7 as of 23 Oct 2026

npm install @nyariv/sandboxjs@0.9.7

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

0.8.26

This is the first release that contains the fix.

npm install @nyariv/sandboxjs@0.8.26

Tip — Not sure which version your app runs? Vulert can match this fix to it. 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