CVE-2026-33939
handlebars.js: Handlebars.js: Denial of Service via malformed decorator syntax in template compilation
Severity
ImportantRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · March 28, 2026
Updated · November 5, 2026
Description
A flaw was found in Handlebars.js. A remote attacker can exploit this by submitting a malformed Handlebars template that includes decorator syntax referencing an unregistered decorator. When the application attempts to compile this template without proper error handling, it triggers an unhandled TypeError. This error causes the Node.js process to crash, resulting in a Denial of Service (DoS) for the affected application.
Statement
This is an Important denial of service flaw in Handlebars.js affecting applications that compile user-supplied templates without proper error handling. A remote attacker can submit a malformed template containing unregistered decorator syntax, leading to an unhandled TypeError and crashing the Node.js process. Red Hat products are vulnerable if they use Handlebars.js in a configuration that allows untrusted input to be compiled at runtime without implementing try/catch blocks or input validation.
CVSS score applicability
The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.
Mitigation
To mitigate this issue, applications utilizing Handlebars.js should implement robust error handling during template compilation and rendering. Specifically, wrap template compilation and rendering calls in try/catch blocks to gracefully handle TypeError exceptions. Alternatively, validate user-supplied template input to reject decorator syntax ({{*...}}) if decorators are not actively used by the application. Employing a pre-compilation workflow, where templates are compiled at build time and only pre-compiled templates are served, can also prevent runtime exploitation. If the application is a service, a restart may be required for changes to take effect.
CVSS / CWE
CVSS 3.1 · 7.5CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
CWE-248 · Uncaught Exception