CVE Database›Document archive›CVE-2026-33916

CVE-2026-33916

handlebars.js: Handlebars: Cross-Site Scripting (XSS) via prototype pollution in partial resolution

Loading…

Severity

Moderate

Red Hat Product Security

4.7

CVSS 3.1

Review impact separately from score.

Published · March 28, 2026

Updated · July 3, 2026

Description

A flaw was found in Handlebars. The resolvePartial() function in the Handlebars runtime does not properly guard against prototype-chain traversal when resolving partial names. This allows an attacker to inject malicious code into web pages. When Object.prototype has been polluted with a string value that matches a partial reference, the polluted string is used as the partial body and rendered without proper HTML escaping. This can result in reflected or stored Cross-Site Scripting (XSS), potentially leading to arbitrary code execution in a user's browser or information disclosure.

Statement

Moderate: This vulnerability in Handlebars allows for Cross-Site Scripting (XSS) when an application uses Handlebars versions 4.0.0 through 4.7.8 and is susceptible to prototype pollution. An attacker could inject malicious code into web pages, potentially leading to arbitrary code execution in a user's browser or information disclosure. This affects Red Hat products that embed or utilize vulnerable versions of the Handlebars library.

CVSS score applicability

The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.

Mitigation

To mitigate this issue, apply Object.freeze(Object.prototype) early in the application startup to prevent prototype pollution. Alternatively, use the Handlebars runtime-only build (handlebars/runtime), which reduces the attack surface by not compiling templates. Be aware that applying Object.freeze(Object.prototype) may impact the functionality of other libraries within the application. Applications utilizing Handlebars may require a restart for these changes to take effect.

CVSS / CWE

CVSS 3.1 · 4.7
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N

CWE-915 · Improperly Controlled Modification of Dynamically-Determined Object Attributes