Improper Encoding or Escaping of Output in handlebars.js - #VU153368

 

Improper Encoding or Escaping of Output in handlebars.js - #VU153368

Published: October 6, 2026


Vulnerability identifier: #VU153368
CSH Severity: Medium
CVSS v4: 2.1 [CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N]
CVE-ID: N/A
CWE-ID: CWE-116
Exploitation vector: Remote access
Exploit availability: No public exploit available

Vulnerability details

The vulnerability allows a remote attacker to execute arbitrary JavaScript in a victim's browser.

The vulnerability exists due to improper encoding or escaping of output in quotedString() in lib/handlebars/compiler/code-gen.js when precompiling attacker-controlled templates for direct embedding in HTML script elements. A remote attacker can supply a crafted template containing a closing script tag followed by malicious markup to execute arbitrary JavaScript in a victim's browser.

A victim must view the resulting HTML document. Ordinary server-side rendering and precompiled templates delivered as external JavaScript files are not affected.


Affected software

handlebars.js

Remediation

Install security update from vendor's website.

handlebars.js - update to 4.7.10

External References

Related Security Bulletins