Live threats

All CVEs / handlebars-lang

CVE-2026-106446handlebars-lang handlebars.js

Remote code execution in Handlebars.js due to insufficient AST validation

Critical 9.8 No auth needed

Priority
74
CVSS 3.1
9.8
EPSS
—
Auth required
No
Published
Oct 6, 2026
Updated
Oct 7, 2026
Category
Application · Cross-platform
Weakness (CWE)
CWE-94, CWE-843
SSVC (CISA)
Exploitation: proof of concept · Automatable: yes · Technical impact: total
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

What happens

Handlebars.js versions 4.0.0 through 4.7.9 fail to properly validate pre-parsed AST objects in compile() and precompile() functions, allowing an attacker to inject JavaScript expressions into unchecked values. An attacker who can supply a malformed AST object instead of a template string can achieve code execution in the server process when the compiled output is rendered or the precompiled output is loaded.

Show the original NVD text

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.

Source text, unmodified. NVD.

What to do

Patch available · fixed versions: 4.7.10

Update handlebars to version 4.7.10 or later. Ensure your application only passes template strings to compile() and precompile(), never AST objects from untrusted sources.

Vendor advisory · github.com ↗

  1. Apply the vendor's security update for handlebars.js.
  2. It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.

Affected packages

EcosystemPackageAffected versionsFixed inHow to upgrade
npm handlebars ≥ 4.0.0 < 4.7.10 4.7.10 npm install handlebars@4.7.10

Per OSV / GitHub Advisories (GHSA-8r5x-fm3f-whwj). Check the version in your lockfile before upgrading.

Affected products

As reported by the CNA that published the CVE. NVD has not added CPEs with versions yet.

Official sources

References

Links published by the sources. Open them with care.