Description
Handlebars provides the power necessary to let users build semantic templates. In versions 4.0.0 through 4.7.8, `Handlebars.compile()` accepts a pre-parsed AST object in addition to a template string. The `value` field of a `NumberLiteral` AST node is emitted directly into the generated JavaScript without quoting or sanitization. An attacker who can supply a crafted AST to `compile()` can therefore inject and execute arbitrary JavaScript, leading to Remote Code Execution on the server. Version 4.7.9 fixes the issue. Some workarounds are available. Validate input type before calling `Handlebars.compile()`; ensure the argument is always a `string`, never a plain object or JSON-deserialized value. Use the Handlebars runtime-only build (`handlebars/runtime`) on the server if templates are pre-compiled at build time; `compile()` will be unavailable.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| handlebars-lang | handlebars.js | >= 4.0.0, < 4.7.9 | — |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | node-handlebars | 3:4.7.9-1 | — |
| Debian 13 | node-handlebars | No fix yet | — |
| Debian 12 | node-handlebars | No fix yet | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 26.10 | node-handlebars | No fix yet | — |
| Ubuntu 26.04 LTS | node-handlebars | No fix yet | — |
| Ubuntu 25.10 | node-handlebars | No fix yet | — |
| Ubuntu 24.04 LTS | node-handlebars | No fix yet | — |
| Ubuntu 22.04 LTS | node-handlebars | No fix yet | — |
Show 2 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 20.04 LTS | node-handlebars | No fix yet | — |
| Ubuntu 18.04 LTS | node-handlebars | No fix yet | — |
Wolfi
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Wolfi rolling | jupyter-base-notebook | 7.6.3-r2 | — |
| Wolfi rolling | lerna | 9.0.7-r2 | — |
| Wolfi rolling | opensearch-dashboards-3 | 3.5.0-r12 | — |
| Wolfi rolling | prism | 5.14.3-r13 | — |
| Wolfi rolling | py3.10-jupyterlab +3 | 4.6.1-r1 | — |
| Wolfi rolling | rancher-api-ui | 1.2.3-r8 | — |
| Wolfi rolling | ts-patch | 4.0.1-r0 | — |
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
GitHub 4 repositories
-
EQSTLab/CVE-2026-33937 ★ 3 · Apr 22, 2026
Handlebars.js AST Injection Remote Code Execution Vulnerability
-
c0gnit00/CVE-2026-33937 ★ 1 · Aug 3, 2026
Python POC, Exploit for Handlebars.js AST Injection RCE, Handlebars.js versions 4.0.0 through 4.7.8 are affected. CVSS score: 9.8 Critical.
-
dinhvaren/cve-2026-33937 ★ 1 · Mar 28, 2026
CVE-2026-33937 Handlebars RCE exploit PoC (AST Injection)
-
garlic-wizard/CVE-2026-33937-for-DarkZeroReturns ★ 0 · Jul 30, 2026
this is a poc for CVE-2026-33937
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| npm | handlebars | >= 4.0.0, < 4.7.9 | 4.7.9 | GHSA-2w6w-674q-4c4q |
Advisories 3
- WID-SEC-2026-4410 IBM App Connect Enterprise: Mehrere Schwachstellen BSI CERT-Bund (WID) · Nov 12, 2026
- WID-SEC-2026-1434 IBM App Connect Enterprise Certified Container: Mehrere Schwachstellen BSI CERT-Bund (WID) · Nov 9, 2026
- WID-SEC-2026-3655 IBM InfoSphere Data Replication: Mehrere Schwachstellen BSI CERT-Bund (WID) · Sep 29, 2026