# CVE-2026-106444: Handlebars precompile script injection in generated code

Source: https://junglewise.ai/threats/cve-2026-106444-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-106444 · Severity: medium · CVSS 4.7 · Published 2026-10-06

Handlebars is a template language compiler that generates JavaScript from template files. Versions 4.0.0 through 4.7.9 fail to escape closing script tags in precompiled template output, allowing attackers to inject arbitrary JavaScript code when precompiled templates are embedded inline in HTML script elements. This can lead to account takeover, data theft, or malware injection in affected web applications.

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-106444 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-106444 being exploited in the wild.

**How severe is CVE-2026-106444?** Medium severity, with a CVSS score of 4.7, published 6 October 2026.

**Which products and versions are affected?** Handlebars.js 4.0.0 to 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-106444?** Yes. handlebars (npm): upgrade to 4.7.10 or later. Until then: Do not precompile untrusted template text. If precompiling user-supplied templates is necessary, serve the generated code as an external JavaScript file rather than inlining it in an HTML script element. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-106444 attacked?** It is attacked over the network.

**Am I affected by CVE-2026-106444?** 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
  ```


Do not precompile untrusted template text. If precompiling user-supplied templates is necessary, serve the generated code as an external JavaScript file rather than inlining it in an HTML script element.

## Technical details

The vulnerability exists in the precompile() function which uses quotedString() to emit static template text into generated JavaScript without properly escaping HTML script delimiters. An attacker can craft template text containing "</script>" sequences that break out of the enclosing script element and execute arbitrary code. The attack requires that an application precompiles attacker-controlled templates and embeds the generated source directly in an inline script element; server-side rendering and externally-served precompiled templates are not affected.

## Affected products

- Handlebars Handlebars.js 4.0.0 to 4.7.9

## Identifiers

- CVE-2026-106444
- GHSA-xw65-4hp5-5hc7

## Timeline

- 2026-10-06: disclosed

## References

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

## Related threats

- [Handlebars AST validation bypass in compile and precompile](https://junglewise.ai/threats/cve-2026-106446-handlebars-provides-the-power-necessary-to-let-users-build)
- [Handlebars prototype pollution RCE via constructor bypass](https://junglewise.ai/threats/cve-2026-106445-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)
