Description
Handlebars provides the power necessary to let users build semantic templates. From 4.0.0 until 4.7.10, Handlebars.compile() and Handlebars.precompile() accept pre-parsed AST objects while validating only selected PathExpression, NumberLiteral, and BooleanLiteral values. This issue bypasses the AST validation introduced in version 4.7.9 for CVE-2026-33937. An attacker who can supply an object instead of a template string can place JavaScript expressions in unchecked values such as Program.blockParams.length, a non-PathExpression parameter depth, a non-string StringLiteral.value, or a non-string PathExpression.original. The compiler emits those values into generated JavaScript, causing code execution in the server process when compile output renders or wherever precompile output is loaded. Applications that pass only template strings are not affected. This issue is fixed in version 4.7.10.
Published: 2026-10-06
Score: 9.8 Critical
EPSS: < 1% Very Low
KEV: No
Impact: Remote Code Execution
Action: Immediate Patch
AI Analysis

Impact

Handlbars.compile and precompile can accept a JavaScript object that represents a parsed template. The vendor only validates a narrow set of node types, leaving unvalidated fields such as Program.blockParams.length, non‑PathExpression depth, non‑string StringLiteral.value, or non‑string PathExpression.original to propagate. Those values are interpolated into the generated JavaScript code. An attacker who can supply such an object can cause arbitrary code execution in the Node.js process that runs the generated template or loads the precompiled bundle. The 9.8 CVSS score reflects the complete loss of confidentiality, integrity and availability. The vulnerability stems from type confusion (CWE‑843) and code injection (CWE‑94).

Affected Systems

Any deployment of Handlebars.js from version 4.0.0 up through, but not including, 4.7.10 is vulnerable. The fix was introduced in 4.7.10, so that release or any newer release is not affected. Applications that only pass raw template strings are not impacted, because the vulnerability requires an object input.

Risk and Exploitability

The exploit hinges on supplying a crafted AST object to the compile or precompile function. This is possible when the application accepts external template definitions or precompiled bundles. Once the object is processed, the injected JavaScript runs in the same context as the server, giving full control. The EPSS score is not published, but the 9.8 CVSS score and the absence from the CISA KEV list still indicate a serious threat. The likely attack vector is the compile/precompile APIs, which accept objects rather than strings.

Generated by OpenCVE AI on October 7, 2026 at 01:44 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Handlebars.js to 4.7.10 or later.
  • If an upgrade is not immediately possible, reject any non‑string inputs to Handlebars.compile() or Handlebars.precompile(); enforce that only plain template strings are accepted.
  • When using precompiled templates, verify they come from trusted sources and that any blockParams or PathExpression attributes are validated to be strings before loading the bundle.

Generated by OpenCVE AI on October 7, 2026 at 01:44 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-8r5x-fm3f-whwj Handlebars: JavaScript Injection via AST Type Confusion in compile (bypass of CVE-2026-33937)
History

Sat, 10 Oct 2026 00:30:00 +0000

Type Values Removed Values Added
References
Metrics threat_severity

None

threat_severity

Important


Fri, 09 Oct 2026 08:00:00 +0000

Type Values Removed Values Added
First Time appeared Handlebarsjs
Handlebarsjs handlebars
Vendors & Products Handlebarsjs
Handlebarsjs handlebars

Wed, 07 Oct 2026 19:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}


Tue, 06 Oct 2026 20:00:00 +0000

Type Values Removed Values Added
Description Handlebars provides the power necessary to let users build semantic templates. From 4.0.0 until 4.7.10, Handlebars.compile() and Handlebars.precompile() accept pre-parsed AST objects while validating only selected PathExpression, NumberLiteral, and BooleanLiteral values. This issue bypasses the AST validation introduced in version 4.7.9 for CVE-2026-33937. An attacker who can supply an object instead of a template string can place JavaScript expressions in unchecked values such as Program.blockParams.length, a non-PathExpression parameter depth, a non-string StringLiteral.value, or a non-string PathExpression.original. The compiler emits those values into generated JavaScript, causing code execution in the server process when compile output renders or wherever precompile output is loaded. Applications that pass only template strings are not affected. This issue is fixed in version 4.7.10.
Title Handlebars: JavaScript Injection via AST Type Confusion in compile (Program.blockParams)
Weaknesses CWE-843
CWE-94
References
Metrics cvssV3_1

{'score': 9.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'}


Subscriptions

Handlebarsjs Handlebars
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-10-07T18:30:12.451Z

Reserved: 2026-10-06T16:49:40.590Z

Link: CVE-2026-106446

cve-icon Vulnrichment

Updated: 2026-10-07T18:27:05.784Z

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-10-06T20:17:26.430

Modified: 2026-10-07T19:17:32.293

Link: CVE-2026-106446

cve-icon Redhat

Severity : Important

Publid Date: 2026-10-06T19:41:55Z

Links: CVE-2026-106446 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-10-09T07:45:18Z

Weaknesses
  • CWE-843

    Access of Resource Using Incompatible Type ('Type Confusion')

  • CWE-94

    Improper Control of Generation of Code ('Code Injection')