REDHAT-BUG-2547112: High severity Handlebars Handlebars vulnerability

Published Oct 6, 2026
·
Updated

Handlebars provides the power necessary to let users build semantic templates. From 4.0.0 until 4.7.10, Handlebars lookupProperty returns Function.prototype.constructor before applying the prototype-access deny list because constructor is an own property of Function.prototype. When an attacker can render a controlled template with allowProtoMethodsByDefault enabled and an accessible function in the template context, the template can traverse from that function through its prototype to Function.prototype and then obtain the Function constructor through the own-property bypass. This permits attacker-controlled JavaScript to execute with the server application's privileges. This issue is fixed in version 4.7.10.

Affected Software

1 affected component
Handlebars Handlebars>=4.0.0<4.7.10

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade Handlebars to a version that resolves this vulnerability.

    Fixed in 4.7.10

Event History

Oct 6, 2026
Data Sourced
via Red Hat·07:54 PM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

What conditions are required for exploitation?

An attacker must be able to render a controlled Handlebars template, the application must have allowProtoMethodsByDefault enabled, and the template context must expose an accessible function. Under those conditions, the attacker can reach the Function constructor and execute JavaScript with the server application's privileges.

2

Are default Handlebars configurations affected?

The described exploit requires allowProtoMethodsByDefault to be enabled. The provided information does not indicate that configurations without this setting enabled are exploitable by this path.

3

What should be done if upgrading cannot happen immediately?

Disable allowProtoMethodsByDefault and prevent untrusted users from supplying or controlling templates. Also avoid exposing functions in template contexts where controlled templates may be rendered.

4

How can I determine whether an application is affected?

Check whether it uses Handlebars versions from 4.0.0 through 4.7.10, enables allowProtoMethodsByDefault, allows attacker-controlled template rendering, and provides accessible functions in template context. The issue is fixed in Handlebars 4.7.10.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203