@ungap/structured-clone is vulnerable to Improper Control of Generation of Code ('Code Injection')
57
Medium Risk
The deserialize function in the structured-clone polyfill reconstructs values by calling new globalThis[name](value) where the constructor name comes from the serialized input. When an application passes attacker-controlled serialized data to deserialize, the attacker can request constructors such as Function, eval, Worker, SharedWorker, setTimeout, or setInterval and trigger code execution in the host environment. The code did not validate the constructor name. The patch introduces a guard that throws TypeError for these dangerous constructors before instantiation.
You are affected if you are using a version that falls within the vulnerable range and using the exported deserialize method.
@ungap/structured-clone is vulnerable to Improper Control of Generation of Code ('Code Injection') in versions 0.0.1 - 1.3.0.
Upgrade the @ungap/structured-clone library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

SOC 2Compliant
ISO 27001Compliant