# realms-shim sandbox breakout via Reflect.construct

Source: https://junglewise.ai/threats/realms-shim-sandbox-breakout-via-reflect-construct-b4a099b5  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2019-10-04. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

Severity: low · CVSS 3.1 · Published 2019-10-04

realms-shim and SES are JavaScript libraries that create sandboxed environments for safely running untrusted code. A critical flaw allows attackers to escape the sandbox by using Reflect.construct on the Function constructor to access objects in the parent realm, enabling arbitrary code execution with full access to the host application (including file system operations).

Technologies: [realms-shim (npm)](https://junglewise.ai/threats/technologies/realms-shim), [ses (npm)](https://junglewise.ai/threats/technologies/ses). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** Low severity, with a CVSS score of 3.1, published 4 October 2019.

**Which products and versions are affected?** realms-shim (npm) SEMVER:introduced=0,fixed=1.2.0; ses (npm) SEMVER:introduced=0,fixed=0.6.3.

**Is there a fix for This vulnerability?** Yes. realms-shim (npm): upgrade to 1.2.0 or later; ses (npm): upgrade to 0.6.3 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is This vulnerability attacked?** It is attacked over the network, in a software library.

**Am I affected?** Check whether you run realms-shim (npm) or ses (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

- realms-shim (npm): upgrade to 1.2.0 or later

  ```sh
  npm install realms-shim@1.2.0
  ```

- ses (npm): upgrade to 0.6.3 or later

  ```sh
  npm install ses@0.6.3
  ```


## Technical details

The vulnerability is a sandbox escape in realms-shim versions prior to 1.2.0 and SES versions prior to 0.6.3. Attackers can exploit Reflect.construct on the sandboxed Function constructor to reach the prototypes of the primal (parent) Realm, bypassing the sandbox boundary. The attack requires no authentication or user interaction and is network-accessible if the sandboxed code is reachable via an application interface. A successful exploit grants the attacker full code execution in the primal realm context, including access to require('fs') and ability to modify application source code. The fix is available in realms-shim 1.2.0 and SES 0.6.3.

## Affected products

- Agoric realms-shim < 1.2.0
- Agoric SES < 0.6.3

## Timeline

- 2019-10-04: disclosed
- 2019-10-02: patched: realms-shim 1.2.0 and SES 0.6.3 released

## References

- [https://github.com/Agoric/realms-shim/security/advisories/GHSA-6jg8-7333-554w](https://github.com/Agoric/realms-shim/security/advisories/GHSA-6jg8-7333-554w)
- [https://github.com/Agoric/realms-shim](https://github.com/Agoric/realms-shim)

## Related threats

- [ses library variable scope leakage in Compartment isolation](https://junglewise.ai/threats/cve-2025-32792-ses-library-variable-scope-leakage-in-compartment-isolation)
- [Endo SES dynamic import and spread operator sandbox escape](https://junglewise.ai/threats/cve-2023-39532-endo-ses-dynamic-import-and-spread-operator-sandbox-escape)
- [SES TypedArray hardening bypass with non-canonical numeric properties](https://junglewise.ai/threats/ses-typedarray-hardening-bypass-with-non-canonical-numeric-properties-cd848030)
- [realms-shim prototype pollution sandbox bypass](https://junglewise.ai/threats/cve-2021-23543-realms-shim-prototype-pollution-sandbox-bypass)
- [realms-shim prototype pollution sandbox bypass](https://junglewise.ai/threats/cve-2021-23594-realms-shim-prototype-pollution-sandbox-bypass)
