handlebars is vulnerable to Code Injection
98
Critical Risk
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.
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().
handlebars is vulnerable to Code Injection in versions 3.0.0 - 4.7.9.
Upgrade the handlebars 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
ISO 42001Compliant© All Intel data is openly available and commercially licensed.