Intel

AIKIDO-2026-970464

handlebars is vulnerable to Code Injection

CVE-2026-106446Published Oct 8, 2026
October 8, 2026

98

CVE Score

Critical

Code Injection

Are you affected? Scan for Free

TL;DR

Handlebars.compile() and Handlebars.precompile() accept a pre-parsed AST, and the validator only checks values on PathExpression, NumberLiteral, and BooleanLiteral nodes. Values such as Program.blockParams.length, the depth on a non-PathExpression param, or a non-string StringLiteral.value/PathExpression.original are written into the generated JavaScript unchecked. An untrusted AST, such as a parsed JSON request body, can insert arbitrary JavaScript into the generated output so it runs on the server with compile() or wherever the precompiled output later loads. The fix validates these values directly at each compiler write site and restricts node type dispatch to known node types.

How do I fix this?

Upgrade the handlebars 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 an untrusted pre-parsed AST, such as a parsed JSON request body, into compile() or precompile().

Package

Versions

3.0.0 - 4.7.9

Fixed in 4.7.10

Background info

handlebars is vulnerable to Code Injection in versions 3.0.0 - 4.7.9.

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