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.
CVE-2026-33940
This high-severity CVE scores 8.1 under a secondary CVSS source (NVD's own analysis pending). EPSS exploit-prediction score not yet available (the EPSS model rescores nightly; freshly-published CVEs typically appear within 48 hours). GitHub Security Advisory data not yet ingested — confidence will rise once GHSA publishes (typical lag: hours to days for open-source ecosystem CVEs; never for infrastructure-only CVEs).
- High severity, but no confirmed exploitation yet
A fix is available — apply it.
- CVSS v3
- 8.1
- EG Score
- 8.1(low)
- EPSS
- 48.8%
- KEV
- Not listed
Published
March 27, 2026
Last Modified
July 2, 2026
Advisory Details (7)
Auto-updated Jun 30, 2026Affected: Red Hat Enterprise Linux 10",
https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-33940.json2452521 – (CVE-2026-33940) CVE-2026-33940 handlebars.js: Handlebars.js: Arbitrary code execution via crafted template context
https://bugzilla.redhat.com/show_bug.cgi?id=2452521JavaScript Injection via AST Type Confusion by passing an object as dynamic partial · Advisory · handlebars-lang/handlebars.js · GitHub
https://github.com/handlebars-lang/handlebars.js/security/advisories/GHSA-xhpv-hc6g-r9c6v4.7.9
Patch available: handlebars-lang/handlebars.js v4.7.9
https://github.com/handlebars-lang/handlebars.js/releases/tag/v4.7.9commit 68d8df5a88e0 (handlebars-lang/handlebars.js)
Patch available: handlebars-lang/handlebars.js v4.7.9 (contains commit 68d8df5a88e0)
https://github.com/handlebars-lang/handlebars.js/commit/68d8df5a88e0a26fe9e6084c5c6aaebe67b07da2Vendor Advisories for CVE-2026-33940(3)
These vendors published their own advisory mentioning this CVE — often with vendor-specific remediation steps + affected product lists not in NVD.
- RHSA-2026:34342Red Hat Product SecurityCritical
Red Hat Security Advisory: Cluster Observability Operator 1.5.0
- CVE-2026-33940Microsoft Security Response Center (MSRC)High
Handlebars.js has JavaScript Injection via AST Type Confusion when passing an object as dynamic partial
- RHSA-2026:10175Red Hat Product SecurityHigh
Red Hat Security Advisory: Red Hat OpenShift Dev Spaces 3.27.1 Release.
Patch Availability(1)
| Vendor / Ecosystem | Fixed in / Patch | Released | Source |
|---|---|---|---|
| redhat | devspaces/code-rhel9:1776744110 | 2026-04-23 | redhat |
Patches are aggregated from vendor advisories (Red Hat, Microsoft, Cisco, GitHub) and package ecosystems (OSV, GHSA). Multiple rows for the same upstream release have been deduplicated.
Affected Packages
(1 across 1 ecosystem)
npm(1)
| Package | Vulnerable range | Fixed in | Dependents |
|---|---|---|---|
| handlebars | — | 4.7.9 | — |
Weakness Classification(2)
MITRE Common Weakness Enumeration — the root-cause categories this CVE belongs to.
Data Freshness Timeline
(refreshed 8× in last 7d / 11× in last 30d)
Each row is a source pipeline that fetched or updated this CVE on that date, with what changed. For example, "NVD update" means NVD published or revised its analysis for this CVE; "MITRE cvelistV5" means we ingested or refreshed it from the CNA feed. Most recent first.
- 2026-07-06 16:27 UTCEPSS rescore
- 2026-07-06 16:27 UTCEPSS rescore
- 2026-07-06 02:23 UTCEPSS rescore
- 2026-07-06 02:23 UTCEPSS rescore
- 2026-07-05 02:30 UTCEPSS rescore
- 2026-07-04 06:31 UTCEPSS rescore
- 2026-07-01 15:06 UTCEPSS rescore
- 2026-06-30 23:22 UTCEPSS rescore
- 2026-06-30 04:36 UTCEG score recompute
- 2026-06-30 04:36 UTCVendor advisory
- 2026-06-30 04:32 UTCNVD updatefirst tracked
Related CVEs(same vendor + same CWE)
Same vendor
10 shownredhat
Same CWE
10 shownCWE-94
- CVE-2006-1359NVD 0.0EG 9.0EPSS 99%NONE
- CVE-2005-1921NVD 0.0EG 9.0EPSS 100%NONE
- CVE-2005-3302EG 7.3HIGH
- CVE-2005-1876EG 4.5MEDIUM
- CVE-2003-1599EG 0.0NONE
- CVE-2006-1318EG 0.0EPSS 96%NONE
- CVE-2006-1301EG 0.0EPSS 95%NONE
- CVE-2006-1308EG 0.0EPSS 95%NONE
- CVE-2006-1309EG 0.0EPSS 95%NONE
- CVE-2006-1304EG 0.0EPSS 95%NONE
Frequently asked(5)
What is CVE-2026-33940?
When was CVE-2026-33940 disclosed?
Is CVE-2026-33940 actively exploited?
What is the CVSS score of CVE-2026-33940?
How do I remediate CVE-2026-33940?
Dependency Blast Radius
See which npm, PyPI, Go, and Maven packages are affected by CVE-2026-33940
Is Your Infrastructure Affected by CVE-2026-33940?
EchelonGraph automatically scans your cloud infrastructure and maps CVE exposure using blast radius analysis.