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


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.07% (21st 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 IDSNYK-JS-HANDLEBARS-15803082
  • published29 Mar 2026
  • disclosed27 Mar 2026
  • creditUnknown

Introduced: 27 Mar 2026

NewCVE-2026-33938  (opens in a new tab)
CWE-1336  (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.9 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 manipulation of the @partial-block variable in the template data context. An attacker can execute arbitrary JavaScript code on the server by overwriting @partial-block with a crafted Handlebars AST and triggering its evaluation through a subsequent invocation.

Note: This is only exploitable if helpers that accept arbitrary objects are registered and allow mutation of the data context.

Workaround

This vulnerability can be mitigated by using the runtime-only build require('handlebars/runtime'), auditing registered helpers to prevent writing arbitrary values to context objects, and avoiding registration of helpers from third-party packages in contexts where templates or context data can be influenced by untrusted input.

CVSS Base Scores

version 4.0
version 3.1