CVE Tools

CVE-2026-33940

Handlebars.js has JavaScript Injection via AST Type Confusion when passing an object as dynamic partial

CVE-2026-33940 is a code injection in Handlebars-lang Handlebars.js (CVSS 8.1, High).

No known exploitation. EPSS puts it in the 58th percentile. Fixed in 4.7.9.

Check it yourself

OpenVAS · 3 checks

e.g. OID 1.3.6.1.4.1.25623.1.1.9.2026.21021011008100100674

Run the check

Published Updated Sources: CVE.org, NVD

What to do

Find your product and version, then upgrade to the build on the right.

  • Handlebars-lang Handlebars.jsAffected: >= 4.0.0, < 4.7.9Upgrade to: not statedStated by: CVE record
  • Handlebarsjs HandlebarsAffected: ≥ 4.0.0, < 4.7.9Upgrade to: 4.7.9Stated by: NVD

Versions as the sources state them. Full version matrix after sign-in

What it is

From the CVE record

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.

In plain language

No plain-language summary for this CVE yet.

Exploitation

Where each signal puts this CVE on the scale from published to confirmed exploited.

EPSS58th
CISA KEV

Not in the catalog. CISA has not confirmed exploitation.

Public exploits

No public exploit or proof of concept found in the sources we track.

EPSS

0.9% chance of exploitation activity in the next 30 days, which ranks it in the 58th percentile of scored CVEs.

Exploit Prediction Scoring System, FIRST.org. A probability, not a confirmation.

Lifecycle

14 events over 213 days, from the signal feeds we watch.

  1. Patch availablerecord updated
  2. Patch availablerecord updated
  3. Patch availablerecord updated
  4. Patch availablerecord updated
  5. Patch availablerecord updated
  6. OpenVAS check added

Affected products

Technical detail

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H

Scored 8.1 by NVD.

How it is reached

  • Attack Vector NetworkExploitable remotely over the network without any special conditions
  • Attack Complexity HighRequires specific conditions like a race condition or non-default configuration
  • Privileges Required NoneNo authentication required — anyone can exploit this
  • User Interaction NoneNo user interaction needed — fully automated exploitation

Scope

  • Scope UnchangedImpact is limited to the vulnerable component itself

Impact if exploited

  • Confidentiality HighTotal information disclosure — all data in the component is compromised
  • Integrity HighTotal loss of integrity — attacker can modify any data in the component
  • Availability HighTotal denial of service — the component is completely unavailable

Weaknesses

ATT&CK techniques

Mapped from the weaknesses above (CWE to ATT&CK), not observed in attacks.

Sources

Questions about CVE-2026-33940

Is CVE-2026-33940 being exploited?
No exploitation is confirmed and no public exploit is known. EPSS puts the chance of exploitation in the next 30 days at 0.9%.
Which versions are affected by CVE-2026-33940?
Handlebars.js: >= 4.0.0, < 4.7.9. Handlebars: ≥ 4.0.0, < 4.7.9.
How do I fix or mitigate CVE-2026-33940?
Upgrade to 4.7.9 or later. The advisory is on github.com.

Last updated

Related articles

All articles

Watch the software you run.

My Stack ranks new CVEs for your products by real-world exploitation, so the next serious one reaches you without reading every advisory.

We'll flag the next CVE, public exploit or patch for Handlebars.js, not every advisory.