logo
DATABASE RESOURCES PRICING ABOUT US

Sandbox Breakout

Description

## Overview Affected versions of `safe-eval` are vulnerable to a sandbox escape. By accessing object constructors, un-sanitized user input can access the entire standard library and effectively break out of the sandbox. ## Proof of Concept: This code accesses the process object and calls `.exit()` ``` var safeEval = require('safe-eval'); safeEval("this.constructor.constructor('return process')().exit()"); ``` ## Recommendation Update to version 0.4.0 or later ## References - [Issue #5](https://github.com/hacksparrow/safe-eval/issues/5) - [Issue #59](https://github.com/patriksimek/vm2/issues/59) - [GitHub PR fix](https://github.com/hacksparrow/safe-eval/pull/13) - [GitHub Advisory](https://github.com/advisories/GHSA-ww6v-677g-p656)


Affected Software


CPE Name Name Version
safe-eval 0.4.0

Related