# CVE-2026-106446: Handlebars AST validation bypass in compile and precompile

Source: https://junglewise.ai/threats/cve-2026-106446-handlebars-provides-the-power-necessary-to-let-users-build  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-10-06. Updated: 2026-10-06  
License: CC BY 4.0 with a link back

CVE-2026-106446 · Severity: critical · CVSS 9.8 · Published 2026-10-06

Handlebars is a template engine that compiles templates into JavaScript code. Versions 4.0.0 through 4.7.9 fail to validate untrusted abstract syntax tree (AST) objects passed to compile() and precompile(), allowing attackers to inject arbitrary JavaScript code that executes on the server. If an application accepts user-supplied AST objects instead of template strings, an attacker can achieve remote code execution.

Technologies: [Handlebars.js](https://junglewise.ai/threats/technologies/handlebars-handlebars-js), [handlebars (npm)](https://junglewise.ai/threats/technologies/npm-handlebars). Vendors: [Handlebars](https://junglewise.ai/threats/vendors/handlebars), [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2026-106446 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-106446 being exploited in the wild.

**How severe is CVE-2026-106446?** Critical severity, with a CVSS score of 9.8, published 6 October 2026.

**Which products and versions are affected?** Handlebars.js 4.0.0 through 4.7.9; handlebars (npm) >= 4.0.0, <= 4.7.9, SEMVER:introduced=4.0.0,fixed=4.7.10.

**Is there a fix for CVE-2026-106446?** Yes. handlebars (npm): upgrade to 4.7.10 or later. Until then: Applications should only pass template strings to compile() and precompile(), never untrusted AST objects. Do not accept pre-parsed AST input from users or external sources. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-106446 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-106446?** Check whether you run Handlebars.js or handlebars (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- handlebars (npm): upgrade to 4.7.10 or later

  ```sh
  npm install handlebars@4.7.10
  ```


Applications should only pass template strings to compile() and precompile(), never untrusted AST objects. Do not accept pre-parsed AST input from users or external sources.

## Technical details

The vulnerability exists in Handlebars compile() and precompile() functions which accept pre-parsed AST objects but perform incomplete validation. An attacker can inject JavaScript expressions via unchecked AST fields including Program.blockParams.length, PathExpression depth parameters, StringLiteral.value non-string values, and PathExpression.original non-string values. The compiler emits these unvalidated values into generated JavaScript, leading to code execution when the compiled template is rendered or when precompiled output is loaded. This bypasses earlier AST validation introduced for CVE-2026-33937.

## Affected products

- Handlebars Handlebars.js 4.0.0 through 4.7.9

## Identifiers

- CVE-2026-106446
- GHSA-8r5x-fm3f-whwj

## Timeline

- 2026-10-06: disclosed: CVE-2026-106446 published

## References

- [https://github.com/handlebars-lang/handlebars.js/commit/703fdcc5fd6cc8d1cc0c33cc19de40c467c4b8d2](https://github.com/handlebars-lang/handlebars.js/commit/703fdcc5fd6cc8d1cc0c33cc19de40c467c4b8d2)
- [https://github.com/handlebars-lang/handlebars.js/pull/2185](https://github.com/handlebars-lang/handlebars.js/pull/2185)

## Related threats

- [Handlebars prototype pollution RCE via constructor bypass](https://junglewise.ai/threats/cve-2026-106445-handlebars-provides-the-power-necessary-to-let-users-build)
- [Handlebars precompile script injection in generated code](https://junglewise.ai/threats/cve-2026-106444-handlebars-provides-the-power-necessary-to-let-users-build)
- [Handlebars.js prototype method access control gap via missing __lookupSetter__](https://junglewise.ai/threats/handlebars-js-prototype-method-access-control-gap-via-missing-f97c2407)
- [Handlebars.js property access validation bypass in container.lookup](https://junglewise.ai/threats/handlebars-js-property-access-validation-bypass-in-container-lookup-25bcfec0)
- [Handlebars handlebars.js code injection in CLI precompiler](https://junglewise.ai/threats/cve-2026-33941-handlebars-handlebars-js-code-injection-in-cli-precompiler)
