Intel

AIKIDO-2026-205969

@sinclair/typebox is vulnerable to Code Injection

Code Injection Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published Today

58

Medium Risk

This Affects:

JS@sinclair/typebox
0.25.0 - 0.27.9
Fixed in 0.27.10
0.31.0 - 0.31.29
Fixed in 0.31.30
0.32.0 - 0.32.36
Fixed in 0.32.37
0.33.0 - 0.33.23
Fixed in 0.33.24
0.34.0 - 0.34.51
Fixed in 0.34.52
Are you affected? Scan for Free

TL;DR

The package generates JavaScript code at runtime and previously embedded dynamic strings/property keys using an escaping approach that could be bypassed by crafted inputs containing quote/JS-syntax fragments, enabling code injection. The fix introduces StringConstant(value) (canonical JSON quoting + proper single-quote escaping) and updates compiler call sites to use it for member-access and literal string comparisons, preventing injected code execution. New regression tests verify that malicious keys/strings do not modify global.__global_state__.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range.

Background info

@sinclair/typebox is vulnerable to Code Injection in versions 0.25.0 - 0.27.9, 0.31.0 - 0.31.29, 0.32.0 - 0.32.36, 0.33.0 - 0.33.23 and 0.34.0 - 0.34.51.

How to fix this

Upgrade the @sinclair/typebox library to the patch version.