Table of Contents
CVSS Score: 10.0 (CRITICAL)
If your application uses SandboxJS to run untrusted JavaScript code safely, you need to patch immediately. A critical vulnerability lets attackers completely escape the sandbox and potentially take control of the entire Node.js process. This isn't a theoretical risk—it's a fundamental breakdown of the security boundary that SandboxJS is supposed to provide.
What Is This CVE?
CVE-2026-34208 affects SandboxJS, a popular JavaScript library used to run untrusted code in a "sandbox"—think of it as a secure container that should prevent malicious scripts from accessing or modifying things they shouldn't.
The problem is in how SandboxJS tries to block attackers from overwriting important global objects like Math.random. While it successfully blocks direct assignments (like Math.random = evilFunction), attackers discovered they can use a more complex path: this.constructor.call(target, attackerObject).
Here's why this matters: this.constructor points to an internal SandboxJS function, and since Function.prototype.call is allowed, attackers can use this combination to write arbitrary data into the host application's global objects. Worse yet, these modifications persist across different sandbox instances in the same process, meaning one malicious script can affect other sandboxed code running later.
In practical terms, this means an attacker can: - Overwrite critical JavaScript functions - Inject malicious code that runs outside the sandbox - Potentially escalate to full system compromise in Node.js applications
Who Is At Risk?
You are vulnerable if you're running SandboxJS versions before 0.8.36. This includes:
- Web applications that execute user-submitted JavaScript code (code playgrounds, educational platforms, automation tools)
- Node.js servers using SandboxJS to safely run plugins or user scripts
- Content management systems that allow JavaScript customization
- Development platforms with code execution features
- Any application that relies on SandboxJS to isolate untrusted JavaScript
If you're unsure whether you use SandboxJS, it might be pulled in as a dependency of another package. Popular use cases include online IDEs, website builders with custom scripting, and applications that run user-generated automation scripts.
How to Check If You're Vulnerable
For Node.js applications:
-
Check your
package.jsonandpackage-lock.jsonfiles:bash grep -r "sandboxjs" package*.json -
Check installed packages:
bash npm list sandboxjs # or yarn list --pattern sandboxjs -
Search your entire project for SandboxJS imports:
bash grep -r "require.*sandboxjs\|import.*sandboxjs" . -
If you find SandboxJS, check the version:
bash npm list sandboxjs --depth=0
If the version shows anything below 0.8.36, you're vulnerable.
For applications using SandboxJS indirectly:
Run a dependency audit to see if any of your packages depend on vulnerable SandboxJS versions:
npm audit
# Look for SandboxJS in the output
How to Fix This
Primary Solution: Update Immediately
Update SandboxJS to version 0.8.36 or later:
npm update sandboxjs
# or
yarn upgrade sandboxjs
Then verify the update worked:
npm list sandboxjs
If You Can't Update Right Now:
- Disable user script execution temporarily if possible
- Add input validation to reject scripts containing
constructor.callpatterns (though this is easily bypassed) - Run SandboxJS in isolated processes rather than threads, so escapes can't affect other parts of your application
- Monitor for unusual JavaScript execution or unexpected global object modifications
Important: There are no reliable workarounds for this vulnerability. The sandbox escape is fundamental to how the library handles constructor references. You must update to 0.8.36.
ThreatChain Coverage
CVE-2026-34208 is already indexed in ThreatChain's CVE database at threatchain.io, where you can search for additional indicators of compromise and related threat intelligence as the security community discovers more details about potential exploits.
Bottom Line
This is a drop-everything-and-patch situation. SandboxJS exists specifically to provide security isolation, and this vulnerability completely defeats that purpose with a perfect CVSS score of 10.0. Any application that processes untrusted JavaScript through vulnerable SandboxJS versions is essentially running that code directly on the host system. Update to version 0.8.36 immediately, and if you can't update right now, consider temporarily disabling any features that execute user-provided JavaScript until you can patch.
Action Items:
1. Search your codebase for SandboxJS usage (direct and indirect dependencies)
2. Update to SandboxJS 0.8.36 or later immediately
3. Test your application after updating to ensure functionality works correctly
4. Review logs for any suspicious JavaScript execution from the past few weeks
5. Consider adding monitoring for unexpected global object modifications in production
This sample is available as a password-protected ZIP (password: infected) for security researchers.
Protect Your Infrastructure with ThreatChain SIEM
Real-time threat detection powered by 2.6M+ indicators. Search any hash, domain, wallet, or IP.
View Pricing