CVE-2026-33940Code Injection in Handlebars

Severity
8.1HIGHNVD
EPSS
0.1%
top 81.89%
CISA KEV
Not in KEV
Exploit
No known exploits
Timeline
PublishedMar 27
Latest updateMar 28

Description

Handlebars provides the power necessary to let users build semantic templates. In versions 4.0.0 through 4.7.8, a crafted object placed in the template context can bypass all conditional guards in `resolvePartial()` and cause `invokePartial()` to return `undefined`. The Handlebars runtime then treats the unresolved partial as a source that needs to be compiled, passing the crafted object to `env.compile()`. Because the object is a valid Handlebars AST containing injected code, the generated Java

CVSS vector

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:HExploitability: 2.2 | Impact: 5.9

Affected Packages3 packages

NVDhandlebarsjs/handlebars4.0.04.7.9
npmhandlebarsjs/handlebars4.0.04.7.9
CVEListV5handlebars-lang/handlebars.js>= 4.0.0, < 4.7.9

Patches

🔴Vulnerability Details

4
OSV
Handlebars.js has JavaScript Injection via AST Type Confusion when passing an object as dynamic partial2026-03-27
GHSA
Handlebars.js has JavaScript Injection via AST Type Confusion when passing an object as dynamic partial2026-03-27
CVEList
Handlebars.js has JavaScript Injection via AST Type Confusion when passing an object as dynamic partial2026-03-27
OSV
CVE-2026-33940: Handlebars provides the power necessary to let users build semantic templates2026-03-27

📋Vendor Advisories

2
Red Hat
handlebars.js: Handlebars.js: Arbitrary code execution via crafted template context2026-03-27
Debian
CVE-2026-33940: node-handlebars - Handlebars provides the power necessary to let users build semantic templates. I...2026

🕵️Threat Intelligence

1
Wiz
CVE-2026-33940 Impact, Exploitability, and Mitigation Steps | Wiz

💬Community

2
Bugzilla
CVE-2026-33940 openbao: Handlebars.js: Arbitrary code execution via crafted template context [fedora-all]2026-03-28
Bugzilla
CVE-2026-33940 openbao: Handlebars.js: Arbitrary code execution via crafted template context [epel-all]2026-03-28
CVE-2026-33940 — Code Injection in Handlebars | cvebase