{"id":"CVE-2026-33939","published":"2026-03-27T21:08:24Z","modified":"2026-09-04T12:04:44Z","title":"Handlebars.js has Denial of Service via Malformed Decorator Syntax in Template Compilation","vendor":"handlebars-lang","product":"handlebars.js","tier":"tail","description":{"text":"Handlebars provides the power necessary to let users build semantic templates. In versions 4.0.0 through 4.7.8, when a Handlebars template contains decorator syntax referencing an unregistered decorator (e.g. `{{*n}}`), the compiled template calls `lookupProperty(decorators, \"n\")`, which returns `undefined`. The runtime then immediately invokes the result as a function, causing an unhandled `TypeError: ... is not a function` that crashes the Node.js process. Any application that compiles user-supplied templates without wrapping the call in a `try/catch` is vulnerable to a single-request Denial of Service. Version 4.7.9 fixes the issue. Some workarounds are available. Wrap compilation and rendering in `try/catch`. Validate template input before passing it to `compile()`; reject templates containing  decorator syntax (`{{*...}}`) if decorators are not used in your application. Use the pre-compilation workflow; compile templates at build time and serve only pre-compiled  templates; do not call `compile()` at request time.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.5,"severity":"HIGH","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00707,"percentile":0.54332,"provenance":"source"},"cwes":[{"id":"CWE-754","name":"Improper Check for Unusual or Exceptional Conditions"},{"id":"CWE-248","name":"Uncaught Exception"}],"references":[{"url":"https://github.com/handlebars-lang/handlebars.js/security/advisories/GHSA-9cx6-37pm-9jff","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/handlebars-lang/handlebars.js/commit/68d8df5a88e0a26fe9e6084c5c6aaebe67b07da2","tags":["x_refsource_MISC"]},{"url":"https://github.com/handlebars-lang/handlebars.js/releases/tag/v4.7.9","tags":["x_refsource_MISC"]},{"url":"https://access.redhat.com/security/cve/CVE-2026-33939","tags":["vdb-entry","x_refsource_REDHAT"]},{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=2452508","tags":["issue-tracking","x_refsource_REDHAT"]},{"url":"https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-33939.json","tags":["x_sadp-csaf-vex"]},{"url":"https://access.redhat.com/errata/RHSA-2026:34342","tags":["vendor-advisory","x_refsource_REDHAT"]},{"url":"https://access.redhat.com/errata/RHSA-2026:10175","tags":["vendor-advisory","x_refsource_REDHAT"]}],"priority":{"score":16.1,"factors":[{"name":"EPSS percentile","points":10.87},{"name":"CVSS severity","points":5.25}]},"vendorSlug":"handlebars-lang","affectedVersions":[{"vendor":"handlebars-lang","product":"handlebars.js","versions":[">= 4.0.0, < 4.7.9"]}],"ssvc":{"exploitation":"poc","automatable":"yes","technicalImpact":"partial","timestamp":"2026-03-30T18:52:18.558792Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"npm","package":"handlebars","vulnerableRanges":[">=4.0.0, <4.7.9"],"patched":["4.7.9"],"from":["GHSA-9cx6-37pm-9jff"],"provenance":"source"}],"summary":{"text":"The Handlebars.js library, in versions 4.0.0 through 4.7.8, mishandles template decorator syntax: referencing an unregistered decorator (such as {{*n}}) yields an undefined value that is invoked as a function, throwing an uncaught TypeError that crashes the Node.js process. An attacker with network access can trigger this with a single unauthenticated request, requiring no user interaction, provided the target application compiles user-supplied templates without a try/catch around the call.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:28:45Z"},"euvd":{"id":"EUVD-2026-16858","exploited":false,"provenance":"source"}}