Skip to content
Vulnerabilities

Handlebars Prototype Pollution Flaw CVE-2026-106445 Permits RCE in v4.0.0-4.7.9, Patch in v4.7.10 Available

A critical remote code execution flaw in Handlebars allows attackers to bypass security controls through a prototype pollution technique.

Illustration: A cracked browser window sits on a desk, its abstract blue shapes bleeding outward like spilled ink.
AI-generated illustration: TechSec Headlines

Key points

  • CVE-2026-106445 enables arbitrary JavaScript execution on servers using vulnerable Handlebars versions.
  • The vulnerability stems from an oversight where own properties bypass the prototype-access deny list.
  • Versions 4.0.0 through 4.7.9 are affected; a patch is available in version 4.7.10.

The short version

  • A critical security vulnerability in the Handlebars templating engine allows for remote code execution.
  • Attackers can bypass the built-in deny list by exploiting how the engine handles prototype properties.
  • Users running Handlebars versions 4.0.0 to 4.7.9 should upgrade to 4.7.10 immediately.

The details

According to GitHub advisory GHSA-p8wg-vrv2-v86f, Handlebars contains a critical severity vulnerability identified as CVE-2026-106445. This flaw allows an attacker who can render a controlled template to inject and execute arbitrary JavaScript code on the server, leading to remote code execution (RCE). The vulnerability exists in Handlebars versions 4.0.0 through 4.7.9. A fix has been confirmed and released in version 4.7.10.

The core issue lies in how the `lookupProperty` function handles property resolution. The function trusts own properties of an object without consulting the security deny list. Normally, values derived from prototypes are checked by `resultIsAllowed`, which blocks dangerous method names like `constructor`. However, because `constructor` is an own property of prototype objects themselves—such as `Function.prototype.constructor`—the deny list is never evaluated for these specific cases.

When a template reaches `Function.prototype`, looking up the `constructor` property returns the `Function` object directly. This happens because `Object.prototype.hasOwnProperty.call` returns true for the prototype's own properties, causing `lookupProperty` to return the value immediately. This bypass allows an attacker to obtain the `Function` constructor and create new functions with attacker-controlled body content.

The context

To exploit this vulnerability, an attacker needs to reach a prototype object where `constructor` is an own property. The proof of concept outlined in the advisory requires only an accessible function in the template context. The configuration `allowProtoMethodsByDefault: true` must be enabled for this specific attack path to succeed, as it permits access to the `proto` property when the result is a function.

The attack chain involves three steps. First, the attacker accesses a function's prototype using a lookup like `{{lookup myFunction "proto"}}`, which resolves to `Function.prototype`. Second, they access the `constructor` via the own property bypass, resolving to the `Function` object itself. Because this is an own property of `Function.prototype`, the deny list entry for `constructor` is skipped. Finally, the attacker uses the obtained `Function` object to construct and execute arbitrary code.

What to watch

Security teams should monitor their Node.js applications for any use of Handlebars templating. Specifically, look for configurations where `allowProtoMethodsByDefault` is set to true, as this increases the attack surface for prototype-based exploitation. Also, watch for any unusual server-side JavaScript execution or unexpected function calls originating from template rendering processes.

What to do and how to stay safe: Handlebars

  • Check if your Node.js projects depend on Handlebars versions between 4.0.0 and 4.7.9.
  • Upgrade to Handlebars version 4.7.10 or later once the vendor provides an update.
  • Review template configurations to disable `allowProtoMethodsByDefault` if it is not strictly required.
  • Monitor server logs for signs of arbitrary JavaScript execution or unexpected function calls.

Step-by-step guide: Automatic Software Updates: Definition, Mechanics and Hidden Risks

General security guidance from the TechSec Headlines newsroom. It is not confirmed advice from the organisations named in this story.

Frequently asked questions

Which Handlebars versions are vulnerable to CVE-2026-106445?

Versions 4.0.0 through 4.7.9 are vulnerable to this prototype bypass vulnerability.

Is there a patch available for this vulnerability?

Yes, a fix has been released in Handlebars version 4.7.10.

What configuration is required for this specific attack path?

The configuration `allowProtoMethodsByDefault: true` must be enabled for the attacker to access the necessary properties.

Sources

  1. GitHub Advisory Database
HandlebarsCVE-2026-106445npmRemote Code ExecutionPrototype Pollution

Related stories

Independent cybersecurity reportingGet Alerts