# CVE-2021-23594: realms-shim prototype pollution sandbox bypass

Source: https://junglewise.ai/threats/cve-2021-23594-realms-shim-prototype-pollution-sandbox-bypass  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2022-01-12. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2021-23594 · Severity: low · CVSS 3.1 · Published 2022-01-12

realms-shim is a JavaScript library that implements a spec-compliant sandbox (isolated execution environment) for untrusted code. A prototype pollution vulnerability allows attackers to modify the inheritance chain of JavaScript objects, breaking out of the sandbox and gaining arbitrary code execution within the application process.

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

## Quick answers

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

**How severe is CVE-2021-23594?** Low severity, with a CVSS score of 3.1, published 12 January 2022.

**Which products and versions are affected?** realms-shim (npm) SEMVER:introduced=0,last_affected=1.2.2.

**Is there a fix for CVE-2021-23594?** No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.

**How is CVE-2021-23594 attacked?** It is attacked over the network.

**Am I affected by CVE-2021-23594?** Check whether you run realms-shim (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.

## Technical details

The vulnerability is a prototype pollution attack (CWE-1321) affecting all versions of realms-shim up to and including 1.2.2. By polluting the prototype chain, an attacker can escape the intended sandbox isolation, leading to arbitrary code execution. The vulnerability is network-reachable and requires no authentication or user interaction—any code execution within the compromised realm can trigger the exploit. A patch is available; users should upgrade to a version beyond 1.2.2.

## Affected products

- Agoric realms-shim all versions up to and including 1.2.2

## Identifiers

- CVE-2021-23594
- GHSA-pwm7-qr6j-3vjg

## Timeline

- 2022-01-10: disclosed: NVD published
- 2022-01-12: advisory: GHSA advisory published

## References

- [https://github.com/Agoric/realms-shim](https://github.com/Agoric/realms-shim)

## Related threats

- [realms-shim prototype pollution sandbox bypass](https://junglewise.ai/threats/cve-2021-23543-realms-shim-prototype-pollution-sandbox-bypass)
- [realms-shim sandbox breakout via transform function](https://junglewise.ai/threats/realms-shim-sandbox-breakout-via-transform-function-6202809c)
- [realms-shim sandbox breakout via Reflect.construct](https://junglewise.ai/threats/realms-shim-sandbox-breakout-via-reflect-construct-b4a099b5)
