Access of Resource Using Incompatible Type ('Type Confusion') Affecting handlebars package, versions >=4.0.0 <4.7.10


Severity

Recommended
0.0
critical
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.64% (50th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Access of Resource Using Incompatible Type ('Type Confusion') vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-JS-HANDLEBARS-20574183
  • published8 Oct 2026
  • disclosed8 Oct 2026
  • creditNick Mykhailyshyn, bhaswanthc, Lương Nguyễn Ngọc Đình, jmoritzc53, n0tra4e, hibrian827, Thai Son Dinh, Nikola Kojic, Ahmed Elmahgob, vk-can, PellaML, shenhuanageshei, kagebunsher, kustundag, ffasterss, sanmatte

Introduced: 8 Oct 2026

NewCVE-2026-106446  (opens in a new tab)
CWE-843  (opens in a new tab)
CWE-94  (opens in a new tab)

How to fix?

Upgrade handlebars to version 4.7.10 or higher.

Overview

handlebars is an extension to the Mustache templating language.

Affected versions of this package are vulnerable to Access of Resource Using Incompatible Type ('Type Confusion') via the compiler's handling of pre-parsed AST objects passed to compile or precompile. When a caller supplies a hand-built or attacker-influenced AST directly to the compiler, AST node values such as path depths, path parts, literal values, content strings, hash pair keys, and block params are written into generated JavaScript code without sufficient validation, allowing an attacker to inject arbitrary code into the compiled template output. The fix moves all AST value validation into the compiler itself, so that values are checked at the point they are written into generated code rather than only at parse time.

CVSS Base Scores

version 4.0
version 3.1