@sinclair/typebox is vulnerable to Code Injection
58
Medium Risk
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__.
You are affected if you are using a version that falls within the vulnerable range.
@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.
Upgrade the @sinclair/typebox 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.

I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant