# CVE-2019-10759: safer-eval sandbox escape and arbitrary code execution

Source: https://junglewise.ai/threats/cve-2019-10759-safer-eval-sandbox-escape-and-arbitrary-code-execution  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2019-10-21. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2019-10759 · Severity: low · CVSS 3.1 · Published 2019-10-21

safer-eval is a JavaScript library that provides sandboxed code evaluation in Node.js and browsers. Versions before 1.3.4 contain a sandbox escape vulnerability that allows attackers to execute arbitrary code by exploiting constructor property access, potentially compromising any application that uses this library to safely evaluate untrusted code. An attacker with low privileges can escape the sandbox and gain full control over the application environment, including access to sensitive environment variables and file systems.

Technologies: [safer-eval (npm)](https://junglewise.ai/threats/technologies/safer-eval). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2019-10759 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2019-10759 being exploited in the wild.

**How severe is CVE-2019-10759?** Low severity, with a CVSS score of 3.1, published 21 October 2019.

**Which products and versions are affected?** safer-eval (npm) SEMVER:introduced=0,fixed=1.3.4.

**Is there a fix for CVE-2019-10759?** Yes. safer-eval (npm): upgrade to 1.3.4 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2019-10759 attacked?** It is attacked over the network.

**Am I affected by CVE-2019-10759?** Check whether you run safer-eval (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- safer-eval (npm): upgrade to 1.3.4 or later

  ```sh
  npm install safer-eval@1.3.4
  ```


## Technical details

safer-eval is a Node.js/browser library designed to provide safer evaluation of code strings compared to native eval(). The vulnerability exists in versions prior to 1.3.4 and is a sandbox escape flaw (CWE-94: Improper Control of Generation of Code). Attackers can bypass the sandbox by leveraging constructor property chains—for example, the payload `console.constructor.constructor('return process')().env` allows direct access to the Node.js process object and environment variables. The attack requires low privileges and no user interaction; a network-reachable endpoint that evaluates untrusted code using vulnerable versions is immediately exploitable. An attacker achieves remote code execution with full application privileges, enabling data theft, malware deployment, and system compromise. The fix is available in version 1.3.4 and later.

## Affected products

- safer-eval safer-eval <1.3.4

## Identifiers

- CVE-2019-10759
- GHSA-r3x4-wr4h-pw33

## Timeline

- 2019-03-08: disclosed
- 2019-10-21: advisory
- 2019-10-15: patched: CVE published; version 1.3.4 available as fix

## References

- [https://snyk.io/vuln/SNYK-JS-SAFEREVAL-173772](https://snyk.io/vuln/SNYK-JS-SAFEREVAL-173772)

## Related threats

- [safer-eval sandbox breakout arbitrary code execution](https://junglewise.ai/threats/safer-eval-sandbox-breakout-arbitrary-code-execution-6fed75c1)
- [safer-eval sandbox breakout via Object.constructor](https://junglewise.ai/threats/safer-eval-sandbox-breakout-via-object-constructor-d8e87f1c)
- [safer-eval sandbox breakout and arbitrary code execution](https://junglewise.ai/threats/cve-2019-10769-safer-eval-sandbox-breakout-and-arbitrary-code-execution)
- [safer-eval sandbox escape via constructor property](https://junglewise.ai/threats/cve-2019-10760-safer-eval-sandbox-escape-via-constructor-property)
