Script injection in Handlebars precompiled templates
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- High
- Impact type
- —
- Confidentiality · integrity · availability
- Low · Low · None
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub.
Summary
Handlebars from 4.0.0 before 4.7.10 is affected. Its Handlebars.precompile() function does not escape sequences that close an HTML script element in the generated code (CWE-116). When an application precompiles attacker-controlled template text and embeds the output directly in an inline script element, injected markup can run in the page, and a user must interact with the page for this to happen.
Written with Claude Haiku 5.5 from the sources below · 2026-10-29
Description from the CNA
Handlebars provides the power necessary to let users build semantic templates. From 4.0.0 until 4.7.10, Handlebars.precompile() uses quotedString() in lib/handlebars/compiler/code-gen.js to emit static template text into generated JavaScript without escaping sequences that terminate an enclosing HTML script element. When an application precompiles attacker-controlled template text and embeds the generated source directly in an inline script element, a closing script delimiter can end the element and cause following attacker-controlled markup to be parsed and executed. Ordinary server-side rendering and precompiled templates served as external JavaScript files are not affected. This issue is fixed in version 4.7.10.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| handlebars-lang | handlebars.js | 4.0.0 to before 4.7.10 | 4.7.10 | Patch available | CNA |
| — | handlebars (npm) | 4.0.0 to before 4.7.10 | 4.7.10 | Patch available | GHSA-xw65-4hp5-5hc7 |
- handlebars.js Vendorhandlebars-lang Affected 4.0.0 to before 4.7.10 Fixed in 4.7.10 Patch available CNA
- handlebars (npm) Vendor— Affected 4.0.0 to before 4.7.10 Fixed in 4.7.10 Patch available GHSA-xw65-4hp5-5hc7
CPE names Threatist (inferred) · 1
Inferred from how NVD named this product before; not given by a source.
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:handlebarsjs:handlebars:*:*:*:*:*:*:*:* | — | — | handlebars-lang |
- cpe:2.3:a:handlebarsjs:handlebars:*:*:*:*:*:*:*:* Versions — — ·handlebars-lang
Remediation
Upgrade the npm package handlebars to version 4.7.10. The sources list no fixed version for handlebars.js.
Written with Claude Haiku 5.5 from the sources below · 2026-10-29
- Fix · CNA handlebars.js (handlebars-lang) Fixed in 4.7.10
- Fix · GHSA-xw65-4hp5-5hc7 handlebars (npm) Fixed in 4.7.10 Advisory →
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
Not affected: 1 product
- Red Hat Hardened Images
Timeline
- 2026-10-06 Threatist record created from CVE-2026-106444
- 2026-10-07 CISA SSVC decision points changed
- 2026-10-07 Priority changed: LOW → MEDIUM
- 2026-10-07 Affected versions changed · Red Hat
- 2026-10-07 CVSS score added · Red Hat
- 2026-10-08 Alias added: GHSA-xw65-4hp5-5hc7
- 2026-10-08 Fix available: npm/[email protected] · GHSA-xw65-4hp5-5hc7
- 2026-10-08 CVSS score added · GHSA-xw65-4hp5-5hc7
- 2026-10-08 Weakness changed · GHSA-xw65-4hp5-5hc7
- 2026-10-08 6 new references · GHSA-xw65-4hp5-5hc7
References
Other 5
- https://github.com/handlebars-lang/handlebars.js/security/advisories/GHSA-xw65-4hp5-5hc7
- https://github.com/handlebars-lang/handlebars.js/pull/2185
- https://github.com/handlebars-lang/handlebars.js/commit/609d1b11c833c9a3e00f56f2f34d22f425446725
- https://github.com/handlebars-lang/handlebars.js/releases/tag/v4.7.10
- https://github.com/handlebars-lang/handlebars.js
More handlebars-lang vulnerabilities
- TI-2026-68926 JavaScript injection in Handlebars compile via crafted AST objects CVSS 3.1CRITICAL 9.8
- TI-2026-26288 Handlebars.js has JavaScript Injection via AST Type Confusion CVSS 3.1CRITICAL 9.8
- TI-2026-68925 JavaScript injection in Handlebars via own property check bypass CVSS 4.0CRITICAL 9.2
- TI-2026-26290 Handlebars.js has Denial of Service via Malformed Decorator Syntax in Template Compilation CVSS 3.1HIGH 7.5
- TI-2026-26292 Handlebars.js has JavaScript Injection in CLI Precompiler via Unescaped Names and Options CVSS 3.1HIGH 8.3
- TI-2026-26291 Handlebars.js has JavaScript Injection via AST Type Confusion when passing an object as dynamic partial CVSS 3.1HIGH 8.1
Sources
- CVE-2026-106444 · CVE Program
- CVE-2026-106444 · NVD
- FIRST EPSS
- GHSA-xw65-4hp5-5hc7 · GitHub Advisory Database · CC BY 4.0
- CVE-2026-106444 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences