CVE-2021-21413 Misuse of `Reference` and other transferable APIs may lead to access to nodejs isolate

High 8.0 Published Updated

Attackers can escape isolated VM contexts to access the main Node.js isolate, potentially executing arbitrary code via native module loading.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2021-21413?

CVE-2021-21413 is a high-severity vulnerability in laverdet isolated-vm, published on 30 Mar 2021. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

isolated-vm is a library for nodejs which gives you access to v8's Isolate interface. Versions of isolated-vm before v4.0.0 have API pitfalls which may make it easy for implementers to expose supposed secure isolates to the permissions of the main nodejs isolate. Reference objects allow access to the underlying reference's full prototype chain. In an environment where the implementer has exposed a Reference instance to an attacker they would be able to use it to acquire a Reference to the nodejs context's Function object. Similar application-specific attacks could be possible by modifying the local prototype of other API objects. Access to NativeModule objects could allow an attacker to load and run native code from anywhere on the filesystem. If combined with, for example, a file upload API this would allow for arbitrary code execution. This is addressed in v4.0.0 through a series of related changes.

Weakness: CWE-913

Which versions are affected by CVE-2021-21413?

2 open source packages ship an affected version, including isolated-vm. It affects 1 product.

PackageAffectedFixed in
isolated-vm npmAll versions4.0.0
isolated-vm npmAll versions4.0.0

Products include Isolated-Vm Project Isolated-Vm.

How do I fix CVE-2021-21413?

Upgrade isolated-vm to 4.0.0 or later.

Is CVE-2021-21413 being exploited?

There is no known exploitation of CVE-2021-21413 in the wild and no public exploit code.

Public exploit code: 1 proofs of concept on GitHub.

Sources

Also known as GHSA-mmhj-4w6j-76h7.

Is CVE-2021-21413 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free