Intel

AIKIDO-2026-519041

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

Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published Aug 4, 2026
August 4, 2026

60

CVE Score

Medium

Improper Control of Generation of Code ('Code Injection')

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.

How do I fix this?

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

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.

Versions

0.0.1 - 2.0.0

Fixed in 2.0.1

Background info

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

Get secure today,
quickly and for free.

Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.

No credit card required | Scan results in 32 seconds.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea