Intel

AIKIDO-2026-519041

structured-clone-es is vulnerable to Improper Control of Generation of Code ('Code Injection')

Improper Control of Generation of Code ('Code Injection') Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published 3 days ago

60

Medium Risk

This Affects:

JSstructured-clone-es
0.0.1 - 2.0.0
Fixed in 2.0.1
Are you affected? Scan for Free

TL;DR

The deserialize function reconstructs values by calling new globalThis[name](message) and new globalThis[type](value), where the constructor name comes from the serialized input. When an application passes attacker-controlled serialized data to deserialize or parse, an attacker can request constructors such as Function and obtain a live function from the payload (new Function(message)), enabling code execution when that value is later invoked. Other globals could also be abused for denial of service or unexpected side effects. The patch restricts deserialization to allow-lists of safe Error subclasses and typed-array / primitive wrappers.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and you pass untrusted data to the exported deserialize or parse methods.

Background info

structured-clone-es is vulnerable to Improper Control of Generation of Code ('Code Injection') in versions 0.0.1 - 2.0.0.

How to fix this

Upgrade the structured-clone-es library to the patch version.