Intel

AIKIDO-2026-970464

handlebars is vulnerable to Code Injection

Code InjectionCVE-2026-106446 Published 6 days ago

98

Critical Risk

This Affects:

JShandlebars
3.0.0 - 4.7.9
Fixed in 4.7.10
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.

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().

Background info

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

How to fix this

Upgrade the handlebars library to the patch version.

Are You Affected?

Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.

Free. No credit card required.

Aikido Platform