Mend.io Vulnerability Database
The largest open source vulnerability database
What is a Vulnerability ID?
New vulnerability? Tell us about it!
CVE-2026-33940
March 27, 2026
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 JavaScript executes arbitrary commands on the server. The attack requires the adversary to control a value that can be returned by a dynamic partial lookup. Version 4.7.9 fixes the issue. Some workarounds are available. First, use the runtime-only build ("require('handlebars/runtime')"). Without "compile()", the fallback compilation path in "invokePartial" is unreachable. Second, sanitize context data before rendering: Ensure no value in the context is a non-primitive object that could be passed to a dynamic partial. Third, avoid dynamic partial lookups ("{{> (lookup ...)}}") when context data is user-controlled.
Affected Packages
https://github.com/handlebars-lang/handlebars.js.git (GITHUB):
Affected version(s) >=v4.0.0 <v4.7.9
Fix Suggestion:
Update to version v4.7.9
https://github.com/handlebars-lang/handlebars.js.git (GITHUB):
Affected version(s) >=v4.0.0 <v4.7.9
Fix Suggestion:
Update to version v4.7.9
https://github.com/handlebars-lang/handlebars.js.git (GITHUB):
Affected version(s) >=v4.0.0 <v4.7.9
Fix Suggestion:
Update to version v4.7.9
https://github.com/handlebars-lang/handlebars.js.git (GITHUB):
Affected version(s) >=v4.0.0 <v4.7.9
Fix Suggestion:
Update to version v4.7.9
https://github.com/handlebars-lang/handlebars.js.git (GITHUB):
Affected version(s) >=v4.0.0 <v4.7.9
Fix Suggestion:
Update to version v4.7.9
https://github.com/handlebars-lang/handlebars.js.git (GITHUB):
Affected version(s) >=v4.0.0 <v4.7.9
Fix Suggestion:
Update to version v4.7.9
https://github.com/handlebars-lang/handlebars.js.git (GITHUB):
Affected version(s) >=v4.0.0 <v4.7.9
Fix Suggestion:
Update to version v4.7.9
https://github.com/handlebars-lang/handlebars.js.git (GITHUB):
Affected version(s) >=v4.0.0 <v4.7.9
Fix Suggestion:
Update to version v4.7.9
https://github.com/handlebars-lang/handlebars.js.git (GITHUB):
Affected version(s) >=v4.0.0 <v4.7.9
Fix Suggestion:
Update to version v4.7.9
https://github.com/handlebars-lang/handlebars.js.git (GITHUB):
Affected version(s) >=v4.0.0 <v4.7.9
Fix Suggestion:
Update to version v4.7.9
https://github.com/handlebars-lang/handlebars.js.git (GITHUB):
Affected version(s) >=v4.0.0 <v4.7.9
Fix Suggestion:
Update to version v4.7.9
handlebars (NPM):
Affected version(s) >=4.0.0 <4.7.9
Fix Suggestion:
Update to version 4.7.9
handlebars (NPM):
Affected version(s) >=4.0.0 <4.7.9
Fix Suggestion:
Update to version 4.7.9
handlebars (NPM):
Affected version(s) >=4.0.0 <4.7.9
Fix Suggestion:
Update to version 4.7.9
handlebars (NPM):
Affected version(s) >=4.0.0 <4.7.9
Fix Suggestion:
Update to version 4.7.9
handlebars (NPM):
Affected version(s) >=4.0.0 <4.7.9
Fix Suggestion:
Update to version 4.7.9
handlebars (NPM):
Affected version(s) >=4.0.0 <4.7.9
Fix Suggestion:
Update to version 4.7.9
handlebars (NPM):
Affected version(s) >=4.0.0 <4.7.9
Fix Suggestion:
Update to version 4.7.9
handlebars (NPM):
Affected version(s) >=4.0.0 <4.7.9
Fix Suggestion:
Update to version 4.7.9
handlebars (NPM):
Affected version(s) >=4.0.0 <4.7.9
Fix Suggestion:
Update to version 4.7.9
handlebars (NPM):
Affected version(s) >=4.0.0 <4.7.9
Fix Suggestion:
Update to version 4.7.9
handlebars (NPM):
Affected version(s) >=4.0.0 <4.7.9
Fix Suggestion:
Update to version 4.7.9
handlebars (NPM):
Affected version(s) >=4.0.0 <4.7.9
Fix Suggestion:
Update to version 4.7.9
handlebars (NPM):
Affected version(s) >=4.0.0 <4.7.9
Fix Suggestion:
Update to version 4.7.9
Do you need more information?
Contact Us
CVSS v4
Base Score:
9.2
Attack Vector
NETWORK
Attack Complexity
HIGH
Attack Requirements
NONE
Privileges Required
NONE
User Interaction
NONE
Vulnerable System Confidentiality
HIGH
Vulnerable System Integrity
HIGH
Vulnerable System Availability
HIGH
Subsequent System Confidentiality
NONE
Subsequent System Integrity
NONE
Subsequent System Availability
NONE
CVSS v3
Base Score:
8.1
Attack Vector
NETWORK
Attack Complexity
HIGH
Privileges Required
NONE
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
HIGH
Integrity
HIGH
Availability
HIGH
Weakness Type (CWE)
Access of Resource Using Incompatible Type ('Type Confusion')
Improper Control of Generation of Code ('Code Injection')
EPSS
Base Score:
0.04