Handlebars.js prototype method access control gap via missing __lookupSetter__

Severity: low · CVSS 3.1 · Published 2026-03-29

Handlebars.js is a popular template engine used to render dynamic content in web applications. When a non-default security setting (allowProtoMethodsByDefault: true) is enabled, a missing blocklist entry allows attackers to access the __lookupSetter__ prototype method in templates, potentially leading to unauthorized data access or modification.

Technologies: handlebars (npm). Vendors: npm.

Quick answers

Is This vulnerability exploited in the wild?
No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.
How severe is This vulnerability?
Low severity, with a CVSS score of 3.1, published 29 March 2026.
Which products and versions are affected?
handlebars (npm) SEMVER:introduced=4.6.0,fixed=4.7.9.
Is there a fix for This vulnerability?
Yes. handlebars (npm): upgrade to 4.7.9 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is This vulnerability attacked?
It is attacked over the network.
Am I affected?
Check whether you run handlebars (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • handlebars (npm): upgrade to 4.7.9 or later
    npm install handlebars@4.7.9

Technical details

The vulnerability is a prototype method access control gap in lib/handlebars/internal/proto-access.js. The blocklist blocks constructor, __defineGetter__, __defineSetter__, and __lookupGetter__ but omits __lookupSetter__, creating an asymmetric security boundary. When the non-default runtime option allowProtoMethodsByDefault: true is set, any prototype method not in the blocklist is permitted by default. An attacker can reference __lookupSetter__ through untrusted template input to bypass access controls. This only affects applications that explicitly enable allowProtoMethodsByDefault: true; the default configuration is not affected. The vulnerability was fixed in version 4.7.9.

Affected products

  • Handlebars Handlebars.js 4.6.0 through 4.7.8

Timeline

  • 2026-03-29: disclosed: GHSA-7rx3-28cr-v5wh published
  • 2026-03-26: patched: Fixed in version 4.7.9

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.